{"thread":{"id":"11340","subject":"[PATCH] allow a single form feed in pre commit hook","startedAt":"2007-12-18T10:09:20Z","lastAt":"2007-12-18T10:09:20Z","messageCount":1,"participants":["Hannes Eder"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"63584","messageId":"5d2716640712180209k7e2fc9fdw74508178cb9fa54f@mail.gmail.com","threadId":"11340","inReplyTo":null,"subject":"[PATCH] allow a single form feed in pre commit hook","fromName":"Hannes Eder","fromEmail":"hannes.eder@gmail.com","sentAt":"2007-12-18T10:09:20Z","receivedAt":"2007-12-18T10:09:20Z","isPatch":true,"sender":{"key":"hannes.eder@gmail.com","avatar":null},"body":"It's not uncommon to have a line with a single form feed in it, e.g.\nthe default GPL COPYING and also in .c files and others. Attached\npatch allows this in the pre-commit hook.\n\n-Hannes\n\ndiff --git a/templates/hooks--pre-commit b/templates/hooks--pre-commit\nindex 7092bae..a759f92 100644\n--- a/templates/hooks--pre-commit\n+++ b/templates/hooks--pre-commit\n@@ -55,7 +55,7 @@ perl -e '\n \tif (s/^\\+//) {\n \t    $lineno++;\n \t    chomp;\n-\t    if (/\\s$/) {\n+\t    if (!/^\\f$/ && /\\s$/) {\n \t\tbad_line(\"trailing whitespace\", $_);\n \t    }\n \t    if (/^\\s* \\t/) {\n"}]}