On my team I've found that it's incredibly useful to commit the merge conflicts and conflict markers, then immediately resolve the conflicts in the next commit. This gives you one commit that shows exactly how the two branches merged together, followed by a commit that shows exactly how the conflicts were resolved. The resolution commit can then be code reviewed independently for a nice clean view of the conflicts introduced in the merge. It also allows you to easily reset to the merge commit and resolve the conflicts differently.
The standard git workflow (and this github feature) seems to promote resolving the conflicts alongside all of the other changes in the merge working copy. This make me nervous, as there's no way to differentiate the new lines that were introduced to resolve merge conflicts from the thousands of lines of (previously reviewed) code from the feature branch.
If you're not careful, completely unrelated working-copy code and behavior can be introduced in a "merge commit" and neither you or any of your reviewers will notice. "Looks good to me."
On the other hand, with your approach you are going to have revisions that won't even build/compile.
If you have automatic builds or/and unit/integration tests, then you'll have failed builds every time you have a merge conflict.
Also, you are kind of 'polluting a well': what if meanwhile someone merges that revision into his/her branch?
Or what if you have automatic merges configured?
You actually can distinguish the new lines. For any non-trivial merge conflict resolution committed as part of the merge, `git show $SHA` will actually show you the conflict resolution. More specifically, if the diff contains anything that's not just a line taken from either of the parents, then that thing is shown.
Or much simpler: do not allow merge conflicts to happen in the first place! Any Pull Request that shows with merge conflicts must be rebased on top of the target branch. Problem solved.
To me this feels like making a commit without unit testing first. When I find a conflict I like to be able to resolve it and then do some unit testing to make sure that my revision didn't miss anything.
I think they explicitly say "simple merge conflicts" in the title. At the end of the day, you should use your own best judgement for when this is useful, and for when you need to go back to your workspace. It's most definitely not meant to be used for every merge conflict.
But not everyone is working on big projects with tests, and not every merge conflict is actually complex code modification.
Sometimes it's just two commits adding something at the end of the file and there's not real conflict, or maybe you modified the same line twice and forgot to pull before doing your 2nd edit.
I'd prefer it not be magic. Just because git COULD merge two of the same line changes doesn't mean it SHOULD.
Maybe you have two vastly different methods to solving the same problem and now they are both in there and both not working instead of leaving it up to the merger to decide.
[+] [-] pkamb|9 years ago|reply
The standard git workflow (and this github feature) seems to promote resolving the conflicts alongside all of the other changes in the merge working copy. This make me nervous, as there's no way to differentiate the new lines that were introduced to resolve merge conflicts from the thousands of lines of (previously reviewed) code from the feature branch.
If you're not careful, completely unrelated working-copy code and behavior can be introduced in a "merge commit" and neither you or any of your reviewers will notice. "Looks good to me."
[+] [-] kovrik|9 years ago|reply
On the other hand, with your approach you are going to have revisions that won't even build/compile.
If you have automatic builds or/and unit/integration tests, then you'll have failed builds every time you have a merge conflict.
Also, you are kind of 'polluting a well': what if meanwhile someone merges that revision into his/her branch? Or what if you have automatic merges configured?
[+] [-] eridius|9 years ago|reply
[+] [-] acchow|9 years ago|reply
[+] [-] chrisamanse|9 years ago|reply
[+] [-] sjrd|9 years ago|reply
[+] [-] nothrabannosir|9 years ago|reply
[+] [-] fogleman|9 years ago|reply
[+] [-] messutied|9 years ago|reply
[+] [-] connorshea|9 years ago|reply
[+] [-] orivej|9 years ago|reply
[+] [-] bjeanes|9 years ago|reply
It can be a bit noisier at first but once you learn to read it, I find it makes resolving conflicts so much easier.
For those of you who haven't used it, try switching it on and/or read https://psung.blogspot.com.au/2011/02/reducing-merge-headach... for more details.
tl;dr it shows
[+] [-] rosstex|9 years ago|reply
[+] [-] Insanity|9 years ago|reply
[+] [-] bklyn11201|9 years ago|reply
[deleted]
[+] [-] jklein11|9 years ago|reply
[+] [-] Ph0X|9 years ago|reply
But not everyone is working on big projects with tests, and not every merge conflict is actually complex code modification.
Sometimes it's just two commits adding something at the end of the file and there's not real conflict, or maybe you modified the same line twice and forgot to pull before doing your 2nd edit.
[+] [-] swampthing|9 years ago|reply
[+] [-] mojuba|9 years ago|reply
[+] [-] aargh_aargh|9 years ago|reply
[+] [-] Anardo|9 years ago|reply
[deleted]
[+] [-] tomschlick|9 years ago|reply
Maybe you have two vastly different methods to solving the same problem and now they are both in there and both not working instead of leaving it up to the merger to decide.
[+] [-] nilved|9 years ago|reply