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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
From 454ede83f7a45741d825f0b6cbdb0be2ac235fdb Mon Sep 17 00:00:00 2001
From: Hannes Eder <Hannes@xxxxxxxxxxxxxx>
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/) {

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux