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

git config --git-all can return non-zero error code

From
TTTimur Tabi <timur@freescale.com>
Date
Nov 19, 2012, 23:02 UTC
Message-ID
<50AABA9B.6090007@freescale.com>

According to the man page for git-config, the --git-all option is not supposed to return an error code:

--get-all
	Like get, but does not fail if the number of values for the key is
	not exactly one.

IMHO, zero is also "not exactly one", but I still get a 1 exit code if the key does not exist.

My .git/config says this:
[user "cq.branch"]
	mastr = upstream/master
git-config --get-all does this:

$ git config --get-all user.cq.branch.master $ echo $? 1 $ git config --get-all user.cq.branch.mastr upstream/master $ echo $? 0

I just want git to return nothing if the key doesn't exist. I don't want it to return an exit code. Is there a way to do this? I think either the code is broken or the documentation needs to be changed.

I'm running git version 1.7.3.4
-- 
Timur Tabi
Linux kernel developer at Freescale
Next: Junio C Hamano
Message 1 of 3 in “git config --git-all can return non-zero error code”
  1. Timur TabiNov 19, 2012
  2. Junio C HamanoNov 20, 2012
  3. config --get-all: it is an error not to see any valueJunio C Hamano, Nov 20, 2012

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.