Skip to content

Commit

Permalink
conflict-marker-size: add test and docs
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Jan 21, 2010
1 parent 2eb41d7 commit 4c73480
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Documentation/gitattributes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
12 changes: 12 additions & 0 deletions t/t6026-merge-attr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4c73480

Please sign in to comment.