From: Timur Tabi <timur@freescale.com>
To: <git@vger.kernel.org>
Subject: git config --git-all can return non-zero error code
Date: Mon, 19 Nov 2012 17:02:51 -0600 [thread overview]
Message-ID: <50AABA9B.6090007@freescale.com> (raw)
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 reply other threads:[~2012-11-19 23:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-19 23:02 Timur Tabi [this message]
2012-11-20 0:10 ` git config --git-all can return non-zero error code Junio C Hamano
2012-11-20 0:24 ` [PATCH] config --get-all: it is an error not to see any value Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50AABA9B.6090007@freescale.com \
--to=timur@freescale.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox