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

Re: pre-commit hook to reject whitespace

From
NKNeal Kreitzinger <nkreitzinger@gmail.com>
Date
Jun 3, 2011, 23:58 UTC
Message-ID
<isbsf8$6id$1@dough.gmane.org>
In-Reply-To
<isbqsf$vh8$1@dough.gmane.org>
On 6/3/2011 6:31 PM, Neal Kreitzinger wrote:
Show 7 quoted lines
> The reference manuals state in the hooks documentation that the pre-commit
> hook sample will reject whitespace only changes.  However, the
> pre-commit.sample in the 1.7.1 and 1.7.5.4 downloads do not appear to do
> this (I'm new to linux scripts).  The appear to only reject non-ascii
> filenames.  Does someone have a pre-commit hook example I can use to reject
> whitespace-only changes?  Thanks!
>

As someone kindly pointed out, the documentation actually says: "The default 'pre-commit' hook, when enabled, catches introduction of lines with trailing whitespaces and aborts the commit when such a line is found."

I'm not seeing this functionality in the pre-commit.sample for 1.7.1 or 1.7.5.4.

v/r, neal

Previous: Neal KreitzingerNext: John Szakmeister
Message 2 of 4 in “pre-commit hook to reject whitespace”
  1. Neal KreitzingerJun 3, 2011
  2. Neal KreitzingerJun 3, 2011
  3. John SzakmeisterJun 4, 2011
  4. Neal KreitzingerJun 4, 2011

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.