git/xdiff
Jonathan Nieder 8a161433a0 xdl_merge(): add optional ancestor label to diff3-style output
The ‘git checkout --conflict=diff3’ command can be used to
present conflicts hunks including text from the common ancestor:

	<<<<<<< ours
	ourside
	|||||||
	original
	=======
	theirside
	>>>>>>> theirs

The added information is helpful for resolving merges by hand, and
merge tools can usually grok it because it is very similar to the
output from diff3 -m.

A subtle change can help more tools to understand the output.  ‘diff3’
includes the name of the merge base on the ||||||| line of the output,
and some tools misparse the conflict hunks without it.  Add a new
xmp->ancestor parameter to xdl_merge() for use with conflict style
XDL_MERGE_DIFF3 as a label on the ||||||| line for any conflict hunks.

If xmp->ancestor is NULL, the output format is unchanged.  Thus, this
change only provides unexposed plumbing for the new feature; it does
not affect the outward behavior of git.

Requested-by: Stefan Monnier <monnier@iro.umontreal.ca>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Bert Wesarg <Bert.Wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-03-20 20:36:10 -07:00
..
xdiff.h xdl_merge(): add optional ancestor label to diff3-style output 2010-03-20 20:36:10 -07:00
xdiffi.c refactor: use bitsizeof() instead of 8 * sizeof() 2009-07-22 21:57:41 -07:00
xdiffi.h Implement the patience diff algorithm 2009-01-07 13:35:44 -08:00
xemit.c Fix various dead stores found by the clang static analyzer 2009-03-15 18:25:24 -07:00
xemit.h Allow alternate "low-level" emit function from xdl_diff 2008-10-25 12:09:31 -07:00
xinclude.h War on whitespace 2007-06-07 00:04:01 -07:00
xmacros.h War on whitespace 2007-06-07 00:04:01 -07:00
xmerge.c xdl_merge(): add optional ancestor label to diff3-style output 2010-03-20 20:36:10 -07:00
xpatience.c Implement the patience diff algorithm 2009-01-07 13:35:44 -08:00
xprepare.c Implement the patience diff algorithm 2009-01-07 13:35:44 -08:00
xprepare.h War on whitespace 2007-06-07 00:04:01 -07:00
xtypes.h War on whitespace 2007-06-07 00:04:01 -07:00
xutils.c xutils: Fix xdl_recmatch() on incomplete lines 2009-08-23 14:38:43 -07:00
xutils.h War on whitespace 2007-06-07 00:04:01 -07:00