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

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

From
Jakub Narebski <jnareb@gmail.com>
Date
Dec 18, 2007, 10:27 UTC
Message-ID
<m3prx4paam.fsf@roke.D-201>
In-Reply-To
<7v4peg1f33.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 12 quoted lines
> "Hannes Eder" <hannes.eder@gmail.com> writes:
> 
> > 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.
> 
> Hmm.  The current trend is to get rid of the whitespace checks from this
> hook and enrich git-diff --check and git-apply --whitespace=error.
> 
> I've been planning to add a new whitespace error rule that allows ^M at
> the end of line, post 1.5.4.  Another rule that allows a lone ^L would
> match what you are doing here, and it would be a good addition as well.
 
There probably should also be 'trailing-empty-lines' rule; also
'eol-at-eof' could be useful as well (ensuring that final line ends
with newline character).

By the way, the check in pre-commit hook also checks for merge conflict markers. Those are not whitespace errors, but are quite similar. It would be nice to have this also .gitattributes controlled, to avoid false positoves for changes in Documentation/*.txt; althought perhaps more strict checking would be enough...

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Junio C Hamano
Message 3 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.