From: Junio C Hamano Date: Wed, 01 Jul 2026 22:16:20 GMT Subject: Re: [PATCH v2 3/4] rev-parse: have --parseopt callers exit 0 on --help Message-ID: In-Reply-To: <20260701212442.1430084-4-sandals@crustytoothpaste.net> "brian m. carlson" writes: > The usual invocation recommended by the manual page is this: > > eval "$(echo "$OPTS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)" > > Thus, the fact that git rev-parse --parseopt still exits 129 in this > case is irrelevant, since the "echo exit $?" will print "exit 129", but > that will be after the "exit 0" printed by Git—and thus ignored, since > the shell will have already exited successfully. Yuck, but ... > if (!err && ctx && ctx->flags & PARSE_OPT_SHELL_EVAL) > - fputs("EOF\n", outfile); > + fputs("EOF\nexit 0\n", outfile); ... it does its job ;-).