Git development
 help / color / mirror / Atom feed
From: Nikolaus Schuetz <nikolauspschuetz@gmail.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] t1401: test symbolic-ref exit codes on a non-symbolic ref
Date: Thu, 20 Aug 2026 10:13:19 -0500	[thread overview]
Message-ID: <20260820151325.58087-1-nikolauspschuetz@gmail.com> (raw)
In-Reply-To: <aoWSqYvANg5AmuCi@pks.im>

> Out of curiosity, what made you address these gaps in particular? Is
> there any motivation, or are you just picking random things to work on?

Not random -- I've been going through git commands, checking whether the
behavior their man pages promise is actually exercised from t/, and
filling the gaps. The idea is to pin the documented contract in a test so
a later refactor can't quietly change it. git-symbolic-ref(1) spells out
both the exit status and the --quiet silence, but neither was tested, so
they stood out.

> This is testing the status quo, but what I think would be good to
> research in this context is why the error codes are different in the
> first place.

Agreed it's surprising, though it's not unique to symbolic-ref: git
rev-parse --verify --quiet does the same thing (exit 1 and silent, vs a
fatal 128 without --quiet). It falls out of how the two paths report in
check_symref() (builtin/symbolic-ref.c): the non-quiet path calls die(),
which always exits 128, while --quiet can't die() -- that would print --
so it returns 1.

> Do we also want to verify that stdout is empty in both cases?

Great idea. I've revised the added tests to redirect stdout and check
for empty stdout in both cases.

Thanks,
Nikolaus

      reply	other threads:[~2026-08-20 15:13 UTC|newest]

Thread overview: 3+ 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 [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=20260820151325.58087-1-nikolauspschuetz@gmail.com \
    --to=nikolauspschuetz@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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