Subject: Re: [PATCH 2/2] transport: don't ignore git-receive-pack(1) exit code on atomic push

From: Patrick Steinhardt <[email-masked]>
Date: Mon, 25 Nov 2024 09:26:41 +0100

On Fri, Nov 15, 2024 at 08:36:20AM +0900, Junio C Hamano wrote:
> Jiang Xin <[email-masked]> writes:
> 
> > If we want to print "Done" in porcelain mode when there are no
> > errors. (In dry run mode, ref-update-errors should not be
> > considered as errors, but the opposite should be regarded as errors).
> 
> Hmph, should we allow dry-run to deliberately behave differently
> from the for-real execution?  Wouldn't it discard the primary value
> of dry-run, to see if it is likely that an operation will succeed
> (or fail)?

I agree, I don't think that this is a good idea. "--dry-run" should
behave as close as possible to the same command executed without that
flag, the only change should be that the underlying operation is not
actually applied in the end. But other than that both the output and the
return values should ideally match exactly so that the user can actually
tell what would happen.

Patrick