From: Phillip Wood <phillip.wood123@gmail.com>
To: Junio C Hamano <gitster@pobox.com>, Patrick Steinhardt <ps@pks.im>
Cc: Nikolaus Schuetz via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org,
Nikolaus Schuetz <nikolauspschuetz@gmail.com>
Subject: Re: [PATCH v2] t1401: check symbolic-ref exit codes and --quiet silence
Date: Mon, 24 Aug 2026 19:35:03 +0100 [thread overview]
Message-ID: <9b5d2c16-3e95-4e3c-8cd9-9c25842bbb4e@gmail.com> (raw)
In-Reply-To: <xmqqbjarqswj.fsf@gitster.g>
On 24/08/2026 19:23, Junio C Hamano wrote:
> Patrick Steinhardt <ps@pks.im> writes:
>
>> I'm still not completely sold that this difference is intentional. As
>> you mentioned elsewhere, in one code path we use `exit(1)` and in the
>> other we use `die(...)` to print an error message, which returs 128. But
>> that to me feels more like nobody noticed that those return different
>> error codes rather than an intentional difference in design, so casting
>> that behaviour into stone with new tests feels wrong to me.
>
> I tend to agree. The choice of 1 would have been more about "we
> need to exit with non-zero status" than "we need to use something
> different from what is used by die()".
I'd always assumed the difference was to allow scripts to distinguish
between an invalid option and the ref not existing, like "git rev-parse
--quiet --verify" and "git show-ref --quiet --verify".
Thanks
Phillip
>
>> I'd suggest that we either:
>>
>> - Continue not checking for the exact error code.
>>
>> - Adapt the `exit(1)` to instead be `die(NULL)` so that we have the
>> same error code across both code paths and then verify that both
>> have the same error code.
>
> Both sounds very sensible.
>
> Especially the former to avoid overspecifying what does not matter
> in the end.
>
> Thanks.
>
next prev parent reply other threads:[~2026-08-24 18:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 21:12 [PATCH] t1401: test symbolic-ref exit codes on a non-symbolic ref Nikolaus Schuetz via GitGitGadget
2026-08-19 11:25 ` Patrick Steinhardt
2026-08-20 15:13 ` Nikolaus Schuetz
2026-08-20 22:20 ` [PATCH v2] t1401: check symbolic-ref exit codes and --quiet silence Nikolaus Schuetz via GitGitGadget
2026-08-24 17:39 ` Patrick Steinhardt
2026-08-24 18:23 ` Junio C Hamano
2026-08-24 18:35 ` Phillip Wood [this message]
2026-08-24 23:05 ` Nikolaus Schuetz
2026-08-25 0:05 ` Junio C Hamano
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=9b5d2c16-3e95-4e3c-8cd9-9c25842bbb4e@gmail.com \
--to=phillip.wood123@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--cc=nikolauspschuetz@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.