ll_merge(): add ancestor label parameter for diff3-style output

Commands using the ll_merge() function will present conflict hunks
imitating ‘diff3 -m’ output if the merge.conflictstyle configuration
option is set appropriately.  Unlike ‘diff3 -m’, the output does not
include a label for the merge base on the ||||||| line of the output,
and some tools misparse the conflict hunks without that.

Add a new ancestor_label parameter to ll_merge() to give callers the
power to rectify this situation.  If ancestor_label is NULL, the output
format is unchanged.  All callers pass NULL for now.

Requested-by: Stefan Monnier <monnier@iro.umontreal.ca>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jonathan Nieder
2010-03-20 19:38:58 -05:00
committed by Junio C Hamano
parent 4bb0936206
commit f01de62e45
6 changed files with 17 additions and 15 deletions

View File

@ -640,7 +640,7 @@ static int merge_3way(struct merge_options *o,
read_mmblob(&src1, a->sha1);
read_mmblob(&src2, b->sha1);
merge_status = ll_merge(result_buf, a->path, &orig,
merge_status = ll_merge(result_buf, a->path, &orig, NULL,
&src1, name1, &src2, name2,
(!!o->call_depth) | (favor << 1));