Re: [PATCH v2 2/3] push: Add support for pre-push hooks
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 15, 2013, 03:12 UTC
- Message-ID
- <7vtxqj5ed0.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <7vip6z7056.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> At least the attached patch is necessary.
Sorry, but the last hunk (see below) is not. It breaks the hook.
Show 18 quoted lines
> 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 > ... >
Show 8 quoted lines
> @@ -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.