From: Junio C Hamano Date: Fri, 16 Nov 2012 21:23:38 GMT Subject: Re: [PATCH] Add support for a 'pre-push' hook Message-ID: <7vmwyhkzs5.fsf@alter.siamese.dyndns.org> In-Reply-To: Matthieu Moy writes: >> +# hook that fails >> +mk_hook_fail () { >> +cat > "$HOOK" <> +#!/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.