git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC PATCH 1/2] sh-setup: Make die take the error code as param.

From
Junio C Hamano <gitster@pobox.com>
Date
May 15, 2011, 20:46 UTC
Message-ID
<7vzkmnofo0.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1f45f5634f08cb0f63d61d8b734a2cf7bebf591b.1305462132.git.iveqy@iveqy.com>
Fredrik Gustafsson <iveqy@iveqy.com> writes:
Show 8 quoted lines
> die used to print all parameters and then exit with code 1. Now die
> prints the first parameter and uses the optional second parameter as the
> exit code. The default exit code is 1.
>
> This allows scripts to control the exit code when they call die.
>
> All current git-code only uses the first parameter of die today so this
> change has no impact on them.
There are two issues in that logic.

The git-sh-setup API is a published interface that third-party Porcelains can use, so it is insufficient to audit only the in-tree code.

Besides, your audit of in-tree code is insufficient. See output from this:
    $ git grep -A1 -n -e 'die .*\\$' -- '*.sh'
The hits in git-bisect.sh and git-rebase--merge.sh both pass two strings.
Can't you instead introduce a new "die_with_status" function and use it?
Previous: Fredrik GustafssonNext: Fredrik Gustafsson
Message 3 of 5 in “submodule update continue”
  1. 0/2 submodule update continueFredrik Gustafsson, May 15, 2011
  2. 1/2 sh-setup: Make die take the error code as param.Fredrik Gustafsson, May 15, 2011
  3. Junio C HamanoMay 15, 2011
  4. 2/2 submodule update: continue when a checkout failsFredrik Gustafsson, May 15, 2011
  5. Junio C HamanoMay 15, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.