Subject: Re: git hook question

From: Jeff King <[email-masked]>
Date: Mon, 1 Jun 2026 01:55:55 -0400

On Mon, Jun 01, 2026 at 02:33:13PM +0900, Junio C Hamano wrote:

> Jeff King <[email-masked]> 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.

Perhaps. I think we've tried to make Git resilient to hooks which do not
read all of their input (by ignoring SIGPIPE). It may be a bug for a
hook to ignore stdin, but depending on what the hook is trying to do,
that information might or might not be relevant.

I do think there is a gotcha for hooks that expect the stdin of their
commands to be hooked up to a terminal to interact with the user.

I certainly don't have any objection to calling more of this out in the
docs, though.

-Peff