[Top][All Lists]

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

Re: overly zealous git hook

From: Jim Meyering
Subject: Re: overly zealous git hook
Date: Mon, 20 Jul 2009 23:40:10 +0200

Bruno Haible wrote:
> Hi Jim,
> The git server at savannah now rejects the normal form of module
> descriptions. I got this error message:
>   modules/pipe-filter:34: ends with blank lines.
>   error: hooks/update exited with error code 2
>   error: hook declined to update refs/heads/master
> I understand that for .c, .h, .texi and many other files, a blank line
> at the end of the file is an indication of sloppiness. Not so for
> gnulib module description files.
> A gnulib modules description formally consists of sections. Every section
> consists of one or more lines. The first line of a section is a special
> keyword, followed by a colon (such as 'Makefile.am:'). Then comes a number
> of content lines. At the end comes - by convention - a blank line. The
> sections are in arbitrary order.

Hi Bruno,

My modules files adhere to the no-trailing-blank-line convention.

> Because a blank line actually belongs to the section that started before
> it (see how it's parsed in gnulib-tool: variable sed_extract_prog), it's
> not a separator. Therefore it's perfectly normal that module descriptions
> end in 1 blank line.
> Likewise for ChangeLog files: They consist of entries, each ending with a
> blank line. Therefore, normally, a ChangeLog file ends with a blank line.
> Can you please exempt the files under modules/ and the ChangeLog files
> from this hooks/update check?

Actually, I see trailing blank lines in any text file
as an opportunity for unexpected merge conflicts, as
one person adds or removes one of those oft-unnoticed lines,
and someone else makes a conflicting change.
Of course, being only at the end of the file, it's not
likely to cause trouble, but I've preferred to remove
them from all of my files for years.

FYI, this change in behavior is the result of savannah upgrading to
the latest version of git, whose git diff --check tests for that.

Since I prefer that the hook continue to apply to all files
for which I have a say, perhaps you'd like to itemize the files
for which you want to allow trailing blank lines?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]