ll-merge: use a longer conflict marker for internal merge

The primary use of conflict markers is to help the user who resolves the final (outer) merge by hand to show which part came from which branch by separating the blocks of lines apart. When the conflicted parts from a "virtual ancestor" merge created by merge-recursive remains in the common ancestor part in the final result, however, the conflict markers that are the same size as the final merge become harder to see. Increase the conflict marker size slightly for these inner merges so that the markers from the final merge and cruft from internal merge can be distinguished more easily. This would help reduce the common issue that prevents "rerere" from being used on a really complex conflict. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Apr 14, 2016 at 15:35 UTC d694a17986a28bbc19e2a6c32404ca24572e400f
3 files changed +9 -4
ll-merge.c
+6 -2
@@ -376,8 +376,12 @@ int ll_merge(mmbuffer_t *result_buf,
376 }
377 }
378 driver = find_ll_merge_driver(ll_driver_name);
379 - if (opts->virtual_ancestor && driver->recursive)
380 - driver = find_ll_merge_driver(driver->recursive);
379 +
380 + if (opts->virtual_ancestor) {
381 + if (driver->recursive)
382 + driver = find_ll_merge_driver(driver->recursive);
383 + marker_size += 2;
384 + }
385 return driver->fn(driver, result_buf, path, ancestor, ancestor_label,
386 ours, our_label, theirs, their_label,
387 opts, marker_size);
t/t6024-recursive-merge.sh
+1 -1
@@ -76,7 +76,7 @@ test_expect_success "result contains a conflict" "test_cmp expect a1"
76
77 git ls-files --stage > out
78 cat > expect << EOF
79 -100644 439cc46de773d8a83c77799b7cc9191c128bfcff 1 a1
79 +100644 ec3fe2a791706733f2d8fa7ad45d9a9672031f5e 1 a1
80 100644 cf84443e49e1b366fac938711ddf4be2d4d1d9e9 2 a1
81 100644 fd7923529855d0b274795ae3349c5e0438333979 3 a1
82 EOF
t/t6036-recursive-corner-cases.sh
+2 -1
@@ -217,7 +217,8 @@ test_expect_success 'git detects differently handled merges conflict' '
217 -L "" \
218 -L "Temporary merge branch 1" \
219 merged empty merge-me &&
220 - test $(git rev-parse :1:new_a) = $(git hash-object merged)
220 + sed -e "s/^\([<=>]\)/\1\1\1/" merged >merged-internal &&
221 + test $(git rev-parse :1:new_a) = $(git hash-object merged-internal)
222 '
223
224 #