threads / patch / 11340

patchallow a single form feed in pre commit hook

Subject: [PATCH] allow a single form feed in pre commit hook

## tl;dr

One message between Dec 18, 2007 and Dec 18, 2007. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Hannes Eder· Dec 18, 2007, 10:09 UTC · lore

It's not uncommon to have a line 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
Show changes to templates/hooks--pre-commit +1 −1
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/) {

← back to recent threads