Re: [PATCH] Add support for a 'pre-push' hook
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 16, 2012, 21:23 UTC
- Message-ID
- <7vmwyhkzs5.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <vpq625547ne.fsf@grenoble-inp.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 12 quoted lines
>> +# hook that fails
>> +mk_hook_fail () {
>> +cat > "$HOOK" <<EOF
>> +#!/bin/sh
>> +exit 1
>> +EOF
>> +chmod +x "$HOOK"
>> +}
>
> I'd add a "touch hook-ran" in the script, a "rm -f hook-ran" before
> launching git-push, and test the file existance after the hook to make
> sure it was ran.And if you create that "evidence that it did ran" file without using "touch", it would be perfect. Unless you are updating the timestamp of an existing file while preserving the contents of it, it is misleading to use "touch".
All other points in your review are good. Thanks.