diffutils-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Diffutils-devel] diff3: option to show OLDER file in unmerged changes


From: Martin Martin
Subject: [Diffutils-devel] diff3: option to show OLDER file in unmerged changes
Date: Wed, 28 Jun 2017 20:28:49 +0000

During a merge, when both side have modified an area, it can be helpful to
see the original version in addition to both modifications.  For example,
it’s not obvious how to merge these:


<<<<<<

The fat cat consumed the rat.

=======

The big fat cat ate the rat.

>>>>>>>


until you see what they both started with:



The fat cat ate the rat.



This change gives diff3 a new flag -2 / --show-2nd, which shows the second
(base, older) file in cases where all 3 files differ.



-A / --show-all does that now, but it also includes conflict markers when
both newer files have the exact same change that’s not in the older file.
And currently, -A is the only way to get the base snippet in your merge:
you have a choice of base snippet plus already-merged sections flagged as
conflicts, or neither, but just base snippet.



You can get this behavior in git by setting “merge.conflictstyle” to
“diff3”.

What's the best way to get you the patch?  As plain text in an email, or a
pull request?


Thanks,

Martin


reply via email to

[Prev in Thread] Current Thread [Next in Thread]