[PATCH 10/10] merge-recursive: add a label for ancestor
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Mar 15, 2010, 08:07 UTC
- Message-ID
- <20100315080703.GJ8824@progeny.tock>
- In-Reply-To
- <20100315074748.GA28827@progeny.tock>
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.
Unfortunately, some tools reportedly cannot parse the conflict hunks because of a small difference from diff3: diff3 -m includes a label for the merge base on the ||||||| line. Humans unfamiliar with the format would do a better job with a label, too. 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, and that might happen in the future.
git rerere does not have trouble parsing this output, since instead of looking for a newline, it looks for whitespace after the ||||||| marker. No other code in git tries to parse conflict hunks.
Reported-by: Stefan Monnier <monnier@iro.umontreal.ca> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> --- I would be interested to know which merge tool chokes on |||||||. ;) As it is, since I haven’t experienced the mechanical misbehavior, I am targetting humans.
That’s the end of the series. Thanks for reading.
Good night, Jonathan
merge-recursive.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c index 017cafd..917397c 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -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);
-- 1.7.0