git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
HEHannes Eder <hannes.eder@gmail.com>
Date
Dec 18, 2007, 09:47 UTC
Message-ID
<5d2716640712180147x36aa3178ja8658e30842c4e52@mail.gmail.com>

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@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/) {
Next: Junio C Hamano
Message 1 of 3 in “allow a single form feed in pre commit hook”
  1. allow a single form feed in pre commit hookHannes Eder, Dec 18, 2007
  2. Junio C HamanoDec 18, 2007
  3. Jakub NarebskiDec 18, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.