4 ms·
IMO, git needs to change the default for merge.conflictstyle. The default "merge" style is abysmal, it does not give you enough information to correctly resolve
by kentonv 3y ago
IMO, git needs to change the default for merge.conflictstyle. The default "merge" style is abysmal, it does not give you enough information to correctly resolve conflicts in isolation -- you have to actually look up the changes separately to understand what each was doing. diff3 gives you sufficient information so you don't have to look up anything. I haven't tried the enhanced versions like kdiff3 or zdiff3 or whatever, it sounds like they may be marginally better, but the difference between the default and diff3 is night and day.
I've seen so many new engineers struggle for years not being able to figure out conflicts until someone tells them about diff3. The default here has likely wasted millions of dollars of productivity.
- Too 3y agoEven better: Use a visual 3-way mergetool instead of working with the raw text. If that’s too much for you, vscode renders the conflict similar to the raw representation but with pretty “accept mine” buttons next to it.
- kentonv 3y agoThose merge tools typically take the raw conflict markers as input, and cannot give you as nice of a UI if they are two-way markers instead of 3-way. So you still want to change the default conflict style.
- Too 3y agoTypically you just type “git mergetool” and the tool launches without you having to care about the marker format.
- 63stack 3y agoParent comment is saying that the merge tool is not going to be able to interpret the conflicts in the file without having diff3 configured as the marker format.
- Too 3y agoWrong. git mergetool command passes the 3 versions of the files in whole. No conflict markers.
- kentonv 3y agoFine. But if someone knows to use mergetool, they probably don't have a problem to begin with. My concern is for all of the junior developers out there who are getting conflicts with terrible default conflict marker style and are struggling through it because they didn't know there was a better option. Educating everyone on how to use `git mergetool` would be great but it is hard. Changing the default so that conflict markers is understandable is easy and benefits everyone.