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

Re: git hook question

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 1, 2026, 05:33 UTC
Message-ID
<xmqqcxyaakpy.fsf@gitster.g>
In-Reply-To
<20260529052141.GA1099450@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I don't think so; the command is expected to handle (or ignore) the
> arguments as appropriate.

We should also caution that the command is expected to handle not just the arguments but its standard input. Not reading any and exiting may be a no-no for some hooks.

And unlike command line arguments, there is no handy way to say "I do not care what the input is" (other than putting "cat >/dev/null;" in front of what you really want to do, that is).

Previous: Jeff KingNext: Jeff King
Message 7 of 10 in “git hook question”
  1. Wesley SchwengleMay 29, 2026
  2. Jeff KingMay 29, 2026
  3. Wesley SchwengleMay 29, 2026
  4. WesleyMay 29, 2026
  5. Ben KnobleMay 29, 2026
  6. Jeff KingMay 29, 2026
  7. Junio C HamanoJun 1, 2026
  8. Jeff KingJun 1, 2026
  9. Jeff KingMay 29, 2026
  10. Adrian RatiuJun 3, 2026

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.