git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Junio C HamanoNext: Aaron Schrab
Message 17 of 22 in “pre-push hook support”
  1. 0/4 pre-push hook supportAaron Schrab, Dec 28, 2012
  2. 1/4 hooks: Add function to check if a hook existsAaron Schrab, Dec 28, 2012
  3. Junio C HamanoDec 29, 2012
  4. Aaron SchrabDec 29, 2012
  5. Junio C HamanoDec 29, 2012
  6. 2/4 hooks: support variable number of parametersAaron Schrab, Dec 28, 2012
  7. 3/4 push: Add support for pre-push hooksAaron Schrab, Dec 28, 2012
  8. 4/4 Add sample pre-push hook scriptAaron Schrab, Dec 28, 2012
  9. Junio C HamanoDec 29, 2012
  10. Aaron SchrabDec 29, 2012
  11. Junio C HamanoDec 29, 2012
  12. 0/3 pre-push hook supportAaron Schrab, Jan 13, 2013
  13. 1/3 hooks: Add function to check if a hook existsAaron Schrab, Jan 13, 2013
  14. 2/3 push: Add support for pre-push hooksAaron Schrab, Jan 13, 2013
  15. Junio C HamanoJan 14, 2013
  16. Junio C HamanoJan 15, 2013
  17. Junio C HamanoJan 15, 2013
  18. 3/3 Add sample pre-push hook scriptAaron Schrab, Jan 13, 2013
  19. Junio C HamanoJan 14, 2013
  20. Junio C HamanoJan 14, 2013
  21. Junio C HamanoJan 14, 2013
  22. Junio C HamanoJan 15, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.