Skip to content

Commit

Permalink
feat: add --ff-only to merge commit
Browse files Browse the repository at this point in the history
* Sometimes we want to not include an additional merge commit, but only fast
  forward a git merge.
  • Loading branch information
n-dusan authored and renatav committed Apr 25, 2022
1 parent eaf8806 commit fcf131a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,25 @@ and this project adheres to [Semantic Versioning][semver].

### Added

- Add `--ff-only` to git merge ([235])
- Cache loaded git files ([228])
- Add a flag for generating performance reports of update calls and print total update execution time ([228])

### Changed

- Update `targets_at_revisions` - only update a list of roles if a metadata file was added ([228])
- Update `targets_at_revisions` - only update a list of roles if a metadata file was added ([228])

### Fixed

[235]: https://github.com/openlawlibrary/taf/pull/235
[228]: https://github.com/openlawlibrary/taf/pull/228

## [0.16.0] - 04/16/2022

### Added

- Add `allow_unsafe` flag to git repo class as a response to a recent git security fix ([229])

### Changed

- Remove `no_checkout=True` from `clone` ([226])
Expand All @@ -37,7 +40,6 @@ and this project adheres to [Semantic Versioning][semver].
- Fix updates of repos which only contain one commit ([219])
- Fixed `_validate_urls` and local validation ([216])


[229]: https://github.com/openlawlibrary/taf/pull/229
[226]: https://github.com/openlawlibrary/taf/pull/226
[220]: https://github.com/openlawlibrary/taf/pull/220
Expand Down
5 changes: 3 additions & 2 deletions taf/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,8 +844,9 @@ def list_worktrees(self):
for wt in worktrees
}

def merge_commit(self, commit):
self._git("merge {}", commit, log_error=True)
def merge_commit(self, commit, fast_forward_only=False):
fast_forward_only_flag = "--ff-only" if fast_forward_only else ""
self._git("merge {} {}", commit, fast_forward_only_flag, log_error=True)

def pull(self):
"""Pull current branch"""
Expand Down

0 comments on commit fcf131a

Please sign in to comment.