Git development
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Wesley Schwengle <wesleys@opperschaap.net>,
	Git maillinglist <git@vger.kernel.org>
Subject: Re: git hook question
Date: Mon, 1 Jun 2026 01:55:55 -0400	[thread overview]
Message-ID: <20260601055555.GA16637@coredump.intra.peff.net> (raw)
In-Reply-To: <xmqqcxyaakpy.fsf@gitster.g>

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

> 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.

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

      reply	other threads:[~2026-06-01  5:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-29  5:01 git hook question Wesley Schwengle
2026-05-29  5:21 ` Jeff King
2026-05-29 16:11   ` Wesley Schwengle
2026-05-29 16:22     ` Wesley
2026-05-29 17:52     ` Ben Knoble
2026-05-29 19:23     ` Jeff King
     [not found]       ` <4d938e1e-fdd3-42d6-a879-4d394ee8c00d@opperschaap.net>
2026-05-29 21:00         ` Jeff King
2026-06-03 13:07           ` Adrian Ratiu
2026-06-01  5:33   ` Junio C Hamano
2026-06-01  5:55     ` Jeff King [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260601055555.GA16637@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=wesleys@opperschaap.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox