merge vs rebase -- rebase easier revert and better for packer #581
Replies: 1 comment 6 replies
-
Well, I just heard it from @clason tbh :P I'll try my best to explain my understanding of it:
I don't think that's true, the merge commit is empty in most cases, it only contains changes itself if there's a conflict between the master and the merged branch.
I could imagine that packer finds the point where the branch diverged from master and lists all commits since then, and this could include some commits to master, which would be listed a second time. Rebasing some branch on master effectively replays the commits of the branch on master, so the first commit of the branch points to (has as its' parent) the latest commit to master.
Which is a much cleaner history Reverting is probably easier without the merge since the reverted commit might modify a line that was changed in both master and the branch, and this change (on master) would now also depend on the merge-commit to be a complete unit of change, while in the rebased version the commit (in the best case) contains the modifications to be compatible with master. Let's hope all that was correct, if it wasn't, this is the internet, so somebody will probably (hopefully) correct me :D |
Beta Was this translation helpful? Give feedback.
-
Hi,
in #514 it was written that when rebasing, the history is better for packer and allows for much easier reverts. Just being curious why is that so?
While the title may be a bit controversial, I definitely do not intend to start a whole discussion about merge vs rebase. I'd rather explore just these (two) facets (or moreover results) of the differences.
Beta Was this translation helpful? Give feedback.
All reactions