Skip to content

Commit

Permalink
merge-recursive: add a label for ancestor
Browse files Browse the repository at this point in the history
git merge-recursive (and hence git merge) will present conflict hunks
in output something like what ‘diff3 -m’ produces if the
merge.conflictstyle configuration option is set to diff3.
There is a small difference from diff3: diff3 -m includes a label
for the merge base on the ||||||| line.

Tools familiar with the format and humans unfamiliar with the format
both can benefit from such a label.  So mark the start of the text
from the merge bases with the heading "||||||| merged common
ancestors".

It would be nicer to use a more informative label.  Perhaps someone
will provide one some day.

git rerere does not have trouble parsing the new output, and its
preimage ids are unchanged since it has its own code for re-creating
conflict hunks.  No other code in git parses conflict hunks.

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>
  • Loading branch information
Jonathan Nieder authored and Junio C Hamano committed Mar 21, 2010
1 parent bf975d3 commit 7ca56aa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions merge-recursive.c
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,7 @@ int merge_recursive(struct merge_options *o,
if (!o->call_depth)
read_cache();

o->ancestor = "merged common ancestors";
clean = merge_trees(o, h1->tree, h2->tree, merged_common_ancestors->tree,
&mrtree);

Expand Down

0 comments on commit 7ca56aa

Please sign in to comment.