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

Re: git pull fails to exit with non-zero status after fatal error

From
Junio C Hamano <junkio@cox.net>
Date
Mar 3, 2007, 22:17 UTC
Message-ID
<7vlkie7z0s.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20070303212348.GA17796@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
Show 13 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
>> On Sat, 3 Mar 2007, Junio C Hamano wrote:
>> 
>> > -	finish "$new_head" "Fast forward"
>> > +	finish "$new_head" "Fast forward" || exit
>> 
>> Doesn't "exit" default to "exit 0"?
>
> No, it carries the exit status of the prior failed command if the
> prior command failed.  ;-)
>
> For what its worth, I learned that only while hacking on git-merge.
> I think it is highly non-obvious.

Sorry to be a traditionalist. "sequence && of && commands || exit" is an established bourne shell idiom.

I do not mind if somebody proposed to change that to "... || exit $?" to unconfuse uninitiated, though.

Previous: Shawn O. PearceNext: Johannes Schindelin
Message 7 of 8 in “git pull fails to exit with non-zero status after fatal error”
  1. Larry StreepyMar 3, 2007
  2. Johannes SchindelinMar 3, 2007
  3. Larry StreepyMar 3, 2007
  4. Junio C HamanoMar 3, 2007
  5. Johannes SchindelinMar 3, 2007
  6. Shawn O. PearceMar 3, 2007
  7. Junio C HamanoMar 3, 2007
  8. Johannes SchindelinMar 3, 2007

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.