git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Make default pre-commit hook less noisy

From
JHJean-Luc Herren <jlh@gmx.ch>
Date
Jan 14, 2008, 21:47 UTC
Message-ID
<478BD87E.7030606@gmx.ch>

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 <jlh@gmx.ch>
---
As far as I know, this will still properly match all conflict
markers, even those by cvs or svn.
 templates/hooks--pre-commit |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/templates/hooks--pre-commit b/templates/hooks--pre-commit
index 7092bae..b25dce6 100644
--- a/templates/hooks--pre-commit
+++ b/templates/hooks--pre-commit
@@ -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", $_);
 	    }
 	}
-- 
1.5.3.8
Next: Junio C Hamano
Message 1 of 2 in “Make default pre-commit hook less noisy”
  1. Make default pre-commit hook less noisyJean-Luc Herren, Jan 14, 2008
  2. Junio C HamanoJan 14, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.