Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: Karthik Nayak <karthik.188@gmail.com>,
	 git@vger.kernel.org, kristofferhaugsbakk@fastmail.com,
	 Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: [PATCH v2] hook: introduce the report hook for git-receive-pack(1)
Date: Fri, 21 Aug 2026 09:55:40 -0700	[thread overview]
Message-ID: <xmqqy0dzpg4z.fsf@gitster.g> (raw)
In-Reply-To: <aohXatWhxCAUQTcq@pks.im> (Patrick Steinhardt's message of "Fri, 21 Aug 2026 15:49:30 +0200")

Patrick Steinhardt <ps@pks.im> writes:

> On Fri, Aug 21, 2026 at 03:34:58PM +0200, Karthik Nayak wrote:
> [snip]
>> - Exit 0: the hook's stdout is used as the report. The hook can
>>   rewrite 'ok' lines to 'ng' lines to signal per-ref rejection to the
>>   client while receive-pack itself exits cleanly. The client marks
>>   rejected refs as '[remote rejected]' and exits with a non-zero
>>   status if any ref is 'ng'.
>> 
>> - Non-zero exit: the hook's stdout is discarded, receive-pack calls
>>   die(), and no report is sent to the client at all. The client
>>   observes a sideband disconnect and reports 'the remote end hung up
>>   unexpectedly', treating the entire push as failed.
>
> I was thinking about this case a bit more. Should we maybe handle it
> similarly to the pre-receive hook instead of dieing? If that hook fails
> we basically update all references to "pre-receive hook declined",
> whereas we could update all of them to "report hook failed". That might
> make for a better user experience.

It is a bit different in that pre-receive is all-or-nothing, but I
agree that it makes sense to model a failure case after how it
works.  In general, it helps to explicitly tell the other end that
their action was declined than let them assume that no news is a bad
news.

I also agree with other points in your review, but I consider the
above is the most valuable input ;-).

Thanks.


      parent reply	other threads:[~2026-08-21 16:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18  7:55 [PATCH] hook: introduce the report hook for git-receive-pack(1) Karthik Nayak
2026-08-18 20:54 ` Junio C Hamano
2026-08-19  7:03 ` Kristoffer Haugsbakk
2026-08-19 12:11   ` Karthik Nayak
2026-08-19 14:47     ` Kristoffer Haugsbakk
2026-08-19  7:39 ` Patrick Steinhardt
2026-08-19 13:13   ` Karthik Nayak
2026-08-19 13:20     ` Patrick Steinhardt
2026-08-19 13:24       ` Karthik Nayak
2026-08-20  9:50 ` Phillip Wood
2026-08-20 15:43   ` Junio C Hamano
2026-08-21 12:51   ` Karthik Nayak
2026-08-21 13:34 ` [PATCH v2] " Karthik Nayak
2026-08-21 13:49   ` Patrick Steinhardt
2026-08-21 16:08     ` Karthik Nayak
2026-08-21 16:55     ` Junio C Hamano [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=xmqqy0dzpg4z.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=karthik.188@gmail.com \
    --cc=kristofferhaugsbakk@fastmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    --cc=ps@pks.im \
    /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