public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jeff King <peff@peff•net>
To: "brian m. carlson" <sandals@crustytoothpaste•net>
Cc: git@vger•kernel.org
Subject: Re: Unexpected exit code for --help with rev-parse --parseopt
Date: Sun, 15 Mar 2026 14:16:28 -0400	[thread overview]
Message-ID: <20260315181628.GA953713@coredump.intra.peff.net> (raw)
In-Reply-To: <abblhCBTgamxPOhD@fruit.crustytoothpaste.net>

On Sun, Mar 15, 2026 at 04:59:48PM +0000, brian m. carlson wrote:

> > And then you don't even need to change the exit code of rev-parse itself
> > (since we'd never hit the "exit $?" that the caller tacks on in case of
> > failure). Though I think it might be reasonable to switch it to 0
> > anyway.
> 
> I can do that as well, even though I think that is actually
> substantially more complicated than the first part.  I'll write up a
> bunch of new tests for these cases in addition.

I would be perfectly happy to leave it as-is. The exit code _shouldn't_
matter anymore if the stdout result (with "exit 0") is being eval'd. So
in that case, maybe leaving it as-is might be the more conservative
choice, if the caller has somehow screwed up the eval and we want to
make sure they still exit.

-Peff

  reply	other threads:[~2026-03-15 18:16 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-15  0:52 Unexpected exit code for --help with rev-parse --parseopt brian m. carlson
2026-03-15  3:14 ` Jeff King
2026-03-15 16:59   ` brian m. carlson
2026-03-15 18:16     ` Jeff King [this message]
2026-03-16 22:07 ` [PATCH] rev-parse: have --parseopt callers exit 0 on --help brian m. carlson
2026-03-17  0:47   ` Junio C Hamano
2026-03-17 11:59     ` brian m. carlson
2026-03-17 14:55       ` Jeff King
2026-03-17 15:07         ` Jeff King
2026-03-17 17:06         ` Junio C Hamano
2026-03-17 18:44           ` Jeff King
2026-03-18  0:24             ` brian m. carlson
2026-03-18  1:22               ` Jeff King
2026-03-18  2:45                 ` 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=20260315181628.GA953713@coredump.intra.peff.net \
    --to=peff@peff$(echo .)net \
    --cc=git@vger$(echo .)kernel.org \
    --cc=sandals@crustytoothpaste$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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