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

Re: [PATCH] fetch: remove fetch_if_missing=0

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 5, 2019, 18:58 UTC
Message-ID
<20191105185845.GA94320@google.com>
In-Reply-To
<20191105185322.205317-1-jonathantanmy@google.com>
Jonathan Tan wrote:
> I think it's less error-prone if we always have a "git" command on its
> own on a line, to avoid losing its error code. When piped into another
> invocation, or when command-substituted into an argument (e.g. "echo
> $(git hash-object foo)"), we lose its error code.
Sure, but assignment is a special case:
	if myvar=$(false)
	then
		echo yes
	else
		echo no
	fi
prints "no".

See "Don't use command substitution in a way that discards git's exit code" in t/README for more details.

Thanks, Jonathan

Previous: Jonathan TanNext: Jonathan Tan
Message 7 of 12 in “fetch: remove fetch_if_missing=0”
  1. fetch: remove fetch_if_missing=0Jonathan Tan, Nov 1, 2019
  2. Jonathan NiederNov 1, 2019
  3. Junio C HamanoNov 2, 2019
  4. Eric SunshineNov 2, 2019
  5. Junio C HamanoNov 2, 2019
  6. Jonathan TanNov 5, 2019
  7. Jonathan NiederNov 5, 2019
  8. fetch: remove fetch_if_missing=0Jonathan Tan, Nov 5, 2019
  9. Eric SunshineNov 5, 2019
  10. Junio C HamanoNov 6, 2019
  11. Junio C HamanoNov 8, 2019
  12. Junio C HamanoNov 8, 2019

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.