Open nicocvn opened 3 years ago
Hey, could you try this option --use-merge-strategy
and see if that meets your requirements?
We actually did investigate that option but this was creating a merge commit on the source branch and then re-merging it onto the master branch which somewhat breaks our branching strategy.
Is this something you plan to support in the future? Or is there any interest in a PR?
I took a quick look at the code base and it seems that the rebase operation is controlled from here and initiated based on the strategy stored in the "fusion" options of the main app. I could try to make a proof of concept and see if I can make it work but I am a bit unclear on how you would prefer to expose that option (another strategy for rebasing/merging or a sub-option for the rebase strategy).
I have an offline fork that implements this option; I'll try to put up a PR once I clear it with my employer.
Summary
Add a configuration option to pass
--rebase-merges
for rebase operations.Motivation
From the README:
What we observe in our projects is that this (as expected with
git rebase
) wipes out the merge commits.Our typical workflow with branches is as follows:
release/x.y.z
branch to develop a future release; this branch is protected such that changes can only be incorporated via a merge request with review and approvals,release/x.y.z
branch (via marge-bot) from short-term branches (e.g.issue/xxx
),master
branch which is done via a merge request handled by marge-bot.Because of the rebase operation the merge commits are dropped and the
release/x.y.z
becomes a linear branch with all the commits from the variousissue/xxx
branches. This is not a show stopper but it would be great to have the option to preserve the structure of the branch.The
--rebase-merges
option is specifically designed for this and was introduced in Git 2.18 (--preserve-merges
seems to now be deprecated).