Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] Add support for a 'pre-push' hook

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:55:18

Matthieu Moy [off-list ref] writes:
quoted
+# 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help