Skip to content

Commit 7ca56aa

Browse files
jrngitster
authored andcommitted
merge-recursive: add a label for ancestor
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 <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bf975d3 commit 7ca56aa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

merge-recursive.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,6 +1347,7 @@ int merge_recursive(struct merge_options *o,
13471347
if (!o->call_depth)
13481348
read_cache();
13491349

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

0 commit comments

Comments
 (0)