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

1 messages from 2007-12-18 to 2007-12-18. Participants: Hannes Eder.
Thread: https://gitlist.dev/t/11340

## Hannes Eder, 2007-12-18 10:09

Subject: [PATCH] allow a single form feed in pre commit hook
Message-ID: <5d2716640712180209k7e2fc9fdw74508178cb9fa54f@mail.gmail.com>
URL: https://gitlist.dev/e/5d2716640712180209k7e2fc9fdw74508178cb9fa54f%40mail.gmail.com

```
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

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/) {

```
