Subject: Re: [PATCH v4 05/11] transport: convert pre-push to hook API

From: Junio C Hamano <[email-masked]>
Date: Thu, 18 Dec 2025 08:07:46 +0900

Patrick Steinhardt <[email-masked]> writes:

> On Tue, Dec 16, 2025 at 11:09:52AM +0200, Adrian Ratiu wrote:
> ...
>> The reason is the list was not exhaustive: for refs which we know
>> beforehand will not be pushed (status rejected), there is no need to
>> feed the pre-push hook stdin. It's saving a few cpu cycles in some
>> rejection corner cases, which were missed previously.
>> 
>> I could:
>> 1. Split the extra *_REJECT_* case aditions into a separate commit,
>>    highlighting and explaining this better.
>> 2. Drop the new cases since they are just a minor improvement in this
>>    series, not very important for the series overall.
>> 
>> Any preference?
>
> I'd personally learn towards (2) unless it is fixing an actual bug that
> can be demonstrated. In that case it might make sense to do (1) and
> explain why this wasn't an issue until now.

I tend to agree.  If my hook did something depending on the branches
the pusher is _trying_ to update, not doing (2) would even be a
regression.

If "git push there next seen" attempts to push these two, we know
seen does not fast-forward and locally decide to refrain from
pushing it, it would silently turn into "git push there next", but
the hook may want to behave differently between these two sets of
command line arguments.

Thanks.