Skip to content

Commit 4c73480

Browse files
committed
conflict-marker-size: add test and docs
Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2eb41d7 commit 4c73480

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

Documentation/gitattributes.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,23 @@ When left unspecified, the driver itself is used for both
525525
internal merge and the final merge.
526526

527527

528+
`conflict-marker-size`
529+
^^^^^^^^^^^^^^^^^^^^^^
530+
531+
This attribute controls the length of conflict markers left in
532+
the work tree file during a conflicted merge. Only setting to
533+
the value to a positive integer has any meaningful effect.
534+
535+
For example, this line in `.gitattributes` can be used to tell the merge
536+
machinery to leave much longer (instead of the usual 7-character-long)
537+
conflict markers when merging the file `Documentation/git-merge.txt`
538+
results in a conflict.
539+
540+
------------------------
541+
Documentation/git-merge.txt conflict-marker-size=32
542+
------------------------
543+
544+
528545
Checking whitespace errors
529546
~~~~~~~~~~~~~~~~~~~~~~~~~~
530547

t/t6026-merge-attr.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,18 @@ test_expect_success 'check merge result in working tree' '
7070
7171
'
7272

73+
test_expect_success 'retry the merge with longer context' '
74+
echo text conflict-marker-size=32 >>.gitattributes &&
75+
git checkout -m text &&
76+
sed -ne "/^\([<=>]\)\1\1\1*/{
77+
s/ .*$//
78+
p
79+
}" >actual text &&
80+
grep ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" actual &&
81+
grep "================================" actual &&
82+
grep "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" actual
83+
'
84+
7385
cat >./custom-merge <<\EOF
7486
#!/bin/sh
7587

0 commit comments

Comments
 (0)