All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Luc Herren <jlh@gmx.ch>
To: git@vger.kernel.org
Subject: [PATCH] Make default pre-commit hook less noisy
Date: Mon, 14 Jan 2008 22:47:42 +0100	[thread overview]
Message-ID: <478BD87E.7030606@gmx.ch> (raw)

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

             reply	other threads:[~2008-01-14 21:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-14 21:47 Jean-Luc Herren [this message]
2008-01-14 21:51 ` [PATCH] Make default pre-commit hook less noisy Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=478BD87E.7030606@gmx.ch \
    --to=jlh@gmx.ch \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.