git-machete
git-machete copied to clipboard
What to do if the range of commits to rebase contains a merge commit?
I mean... we could pass --preserve-merges
to git rebase
but I don't think that's really the best approach.
In fact, out of 3 things:
- true (aka 2-parent) merges
- rebases and/or squashes
- stacked branches
one can reasonably only pick two.
Once someone, on a stacked branch (grandchild of a root or deeper) starts rebasing the history that has merge commits... this never ends well.
Let's research the problem systematically, why is it so that people see so many weird merge conflicts... and suggest a solution.
update
, traverse
etc. should detect that a merge commit is going to be rebase... and propose a solution.
Probably doing as little as squashing (in the sense of git machete squash
) the branch right before the rebase might be enough to avoid problem most of the time... but this needs to be researched as well.