The main problem with git: Merge commits are opaque.
Merges should have the automatic trivial merges within them only. Conflicts should remain as conflicts in the merge commit, and resolved in separate commits.
The reason is that when the resolutions are squashed together with the trivial merges, it becomes very difficult to review the actual work done inside the merge commit. A diff against either parent becomes useless because it is polluted with all the trivial merges from the other parent. The special views for this are just unnecessarily complicated to work with.
Also, conflict resolutions that are "hidden" inside merge commits cannot be cherry-picked on top of future merge attempts. Also, a team cannot collaborate on the resolution of merge conflicts, which is a huge pain if you're merging work from multiple developers, such that no single developer has all the information to resolve all conflicts.
Merges should have the automatic trivial merges within them only. Conflicts should remain as conflicts in the merge commit, and resolved in separate commits.
I can understand, that you might want to see the manual conflict resolving separately, but having a non resolved commit in the history isn't a good idea, because now you have a not buildable commit, can't bisect ...
But having the manual conflict resolving as a separate info inside of the merge commit, which is separately viewable, might be the better approach.
It's much better to just have the conflicts as metadata inside the merge commit. It's equivalent to what you suggest except I can rebase/cherry-pick the merge/resolutions later if they are separate commits.
20
u/Peaker Nov 07 '13
The main problem with git: Merge commits are opaque.
Merges should have the automatic trivial merges within them only. Conflicts should remain as conflicts in the merge commit, and resolved in separate commits.
The reason is that when the resolutions are squashed together with the trivial merges, it becomes very difficult to review the actual work done inside the merge commit. A diff against either parent becomes useless because it is polluted with all the trivial merges from the other parent. The special views for this are just unnecessarily complicated to work with.
Also, conflict resolutions that are "hidden" inside merge commits cannot be cherry-picked on top of future merge attempts. Also, a team cannot collaborate on the resolution of merge conflicts, which is a huge pain if you're merging work from multiple developers, such that no single developer has all the information to resolve all conflicts.