Skip to content

Commit

Permalink
Make default pre-commit hook less noisy
Browse files Browse the repository at this point in the history
This hook thought to have found a conflict marker any time it saw
a 7-character combination of any of the characters '<>=' at the
beginning of a line, whereas it should only look for the *same*
character to appear repeatedly.

Also, restrict it to match exactly 7 times, to avoid matching the
underlining with '='-characters often used in documentation.

Signed-off-by: Jean-Luc Herren <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
jlherren authored and gitster committed Jan 14, 2008
1 parent cfc44a1 commit c60b528
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/hooks--pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ perl -e '
if (/^\s* \t/) {
bad_line("indent SP followed by a TAB", $_);
}
if (/^(?:[<>=]){7}/) {
if (/^([<>])\1{6} |^={7}$/) {
bad_line("unresolved merge conflict", $_);
}
}
Expand Down

0 comments on commit c60b528

Please sign in to comment.