Thread (1 message) 1 message, 1 author, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:58

"Shawn O. Pearce" [off-list ref] writes:
Johannes Schindelin [off-list ref] wrote:
quoted
On Sat, 3 Mar 2007, Junio C Hamano wrote:
quoted
-	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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help