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

Re: [PATCH] pre-commit.sample: Diff against the empty tree when HEAD is invalid

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Nov 6, 2009, 17:11 UTC
Message-ID
<20091106171126.GA42592@book.hvoigt.net>
In-Reply-To
<20091105105757.GA31787@atjola.homenet>
Hallo,
On Thu, Nov 05, 2009 at 11:57:57AM +0100, Björn Steinbrink wrote:
Show 5 quoted lines
> This was already the case for the old "diff --check" call, but the new
> one that checks whether there are any non-ascii file names was missing
> it, making that check fail for root commits.
> 
> Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
[...]
> -	test "$(git diff --cached --name-only --diff-filter=A -z |
> +	test "$(git diff --cached --name-only --diff-filter=A -z $against |
Looks sensible to me. Thanks for that fix.

As this went unnoticed for quite some time it seems as either not many are actually using our example hook or at least not starting new projects with it. I fit in the latter group I suppose.

cheers Heiko
Previous: Björn Steinbrink
Message 2 of 2 in “pre-commit.sample: Diff against the empty tree when HEAD is invalid”
  1. pre-commit.sample: Diff against the empty tree when HEAD is invalidBjörn Steinbrink, Nov 5, 2009
  2. Heiko VoigtNov 6, 2009

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.