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

Re: [PATCH] t9903: fix broken && chain

From
Jeff King <peff@peff.net>
Date
Sep 6, 2016, 07:15 UTC
Message-ID
<20160906071507.pmbpsjoo4me3o6za@sigill.intra.peff.net>
In-Reply-To
<61de943c-df93-58e9-ca48-c469a71a1d43@kdbg.org>
On Mon, Sep 05, 2016 at 09:00:47PM +0200, Johannes Sixt wrote:
Show 9 quoted lines
> We might wonder why our && chain check does not catch this case:
> The && chain check uses a strange exit code with the expectation that
> the second or later part of a broken && chain would not exit with this
> particular code.
> 
> This expectation does not work in this case because __git_ps1, being
> the first command in the second part of the broken && chain, records
> the current exit code, does its work, and finally returns to the caller
> with the recorded exit code. This fools our && chain check.
Wow. Good find. Patch itself is obviously correct.
-Peff
Previous: Johannes SixtNext: Junio C Hamano
Message 2 of 3 in “t9903: fix broken && chain”
  1. t9903: fix broken && chainJohannes Sixt, Sep 5, 2016
  2. Jeff KingSep 6, 2016
  3. Junio C HamanoSep 7, 2016

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.