Re: [PATCH v2 3/4] rev-parse: have --parseopt callers exit 0 on --help
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 8 quoted lines
> 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.
> if (!err && ctx && ctx->flags & PARSE_OPT_SHELL_EVAL)
> - fputs("EOF\n", outfile);
> + fputs("EOF\nexit 0\n", outfile);