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