git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Hannes Eder" <hannes.eder@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH] allow a single form feed in pre commit hook
Date: Tue, 18 Dec 2007 10:47:27 +0100	[thread overview]
Message-ID: <5d2716640712180147x36aa3178ja8658e30842c4e52@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 187 bytes --]

It's not uncommon to have a lines with a single form feed in it, e.g.
the default GPL COPYING and also in .c files and others. Attached
patch allows this in the pre-commit hook.

-Hannes

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: pre-commit-hook-allow-form-feed-200712181.patch --]
[-- Type: text/x-diff; name=pre-commit-hook-allow-form-feed-200712181.patch, Size: 591 bytes --]

From 454ede83f7a45741d825f0b6cbdb0be2ac235fdb Mon Sep 17 00:00:00 2001
From: Hannes Eder <Hannes@HannesEder.net>
Date: Tue, 18 Dec 2007 10:21:11 +0100
Subject: [PATCH] allow a lines with just one form feed in pre-commit hook


diff --git a/templates/hooks--pre-commit b/templates/hooks--pre-commit
index 7092bae..a759f92 100644
--- a/templates/hooks--pre-commit
+++ b/templates/hooks--pre-commit
@@ -55,7 +55,7 @@ perl -e '
 	if (s/^\+//) {
 	    $lineno++;
 	    chomp;
-	    if (/\s$/) {
+	    if (!/^\f$/ && /\s$/) {
 		bad_line("trailing whitespace", $_);
 	    }
 	    if (/^\s* \t/) {

             reply	other threads:[~2007-12-18  9:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-18  9:47 Hannes Eder [this message]
2007-12-18 10:18 ` [PATCH] allow a single form feed in pre commit hook Junio C Hamano
2007-12-18 10:27   ` Jakub Narebski
  -- strict thread matches above, loose matches on Subject: below --
2007-12-18 10:09 Hannes Eder

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=5d2716640712180147x36aa3178ja8658e30842c4e52@mail.gmail.com \
    --to=hannes.eder@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).