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

Re: [PATCH v2 2/3] push: Add support for pre-push hooks

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

Junio C Hamano [off-list ref] writes:
At least the attached patch is necessary.
Sorry, but the last hunk (see below) is not.  It breaks the hook.
In the longer term, we may want to discuss what should happen when
the hook exited without even reading what we fed.  My gut feeling is
that we can still trust its exit status (a hook that was badly coded
so it wanted to read from us and use that information to decide but
somehow died before fully reading from us is not likely to exit with
zero status, so we wouldn't diagnosing breakage as a success), but
there may be downsides for being that lax.

If we decide we want to be lax, then the call site of this hook and
the pre-receive hook (is there any other "take info from the
standard input" hook?) need to be modified so that they ignore
sigpipe, I think.

There was a related discussion around this issue about a year ago.

http://thread.gmane.org/gmane.comp.version-control.git/180346/focus=186291
...
quoted hunk
@@ -38,6 +40,7 @@ COMMIT2="$(git rev-parse HEAD)"
 export COMMIT2
 
 write_script "$HOOK" <<'EOF'
+cat >/dev/null
 echo "$1" >actual
 echo "$2" >>actual
 cat >>actual
As this one wants to keep the incoming data to "actual", we do not
want the extra "cat" to slurp everything in.  Sorry for not being
careful.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help