From: Junio C Hamano Date: Thu, 21 Jan 2010 07:49:27 +0000 (-0800) Subject: conflict-marker-size: add test and docs X-Git-Tag: v1.7.0-rc0~48 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4c734803cbd4fac667ba518460c2c0d8725ae3f7;p=git.git conflict-marker-size: add test and docs Signed-off-by: Junio C Hamano --- diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index 814714c56..b396a871b 100644 --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@ -525,6 +525,23 @@ When left unspecified, the driver itself is used for both internal merge and the final merge. +`conflict-marker-size` +^^^^^^^^^^^^^^^^^^^^^^ + +This attribute controls the length of conflict markers left in +the work tree file during a conflicted merge. Only setting to +the value to a positive integer has any meaningful effect. + +For example, this line in `.gitattributes` can be used to tell the merge +machinery to leave much longer (instead of the usual 7-character-long) +conflict markers when merging the file `Documentation/git-merge.txt` +results in a conflict. + +------------------------ +Documentation/git-merge.txt conflict-marker-size=32 +------------------------ + + Checking whitespace errors ~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/t/t6026-merge-attr.sh b/t/t6026-merge-attr.sh index 1ba0a2522..5e439972b 100755 --- a/t/t6026-merge-attr.sh +++ b/t/t6026-merge-attr.sh @@ -70,6 +70,18 @@ test_expect_success 'check merge result in working tree' ' ' +test_expect_success 'retry the merge with longer context' ' + echo text conflict-marker-size=32 >>.gitattributes && + git checkout -m text && + sed -ne "/^\([<=>]\)\1\1\1*/{ + s/ .*$// + p + }" >actual text && + grep ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" actual && + grep "================================" actual && + grep "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" actual +' + cat >./custom-merge <<\EOF #!/bin/sh