From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Nikolay Vladimirov <nikolay@vladimiroff.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] buitin_config: return postitive status in get_value
Date: Sat, 28 Jul 2012 20:29:23 +0700 [thread overview]
Message-ID: <20120728132923.GA31388@do> (raw)
In-Reply-To: <CAJg5NvdAq_zEx2phVGS4EiUfqMtFJA2Bo=y1d3FJyWXtzMwCTw@mail.gmail.com>
On Sat, Jul 28, 2012 at 04:18:49PM +0300, Nikolay Vladimirov wrote:
> But the behavior now seems kind of strange, or maybe I'm missing something:
> # git config foobar; echo $?
> error: key does not contain a section: foobar
> 255
>
> # git config foobar.info; echo $?
> 1
>
> git version 1.7.11.2
>
> I would generally expect the both to behave the same way.
Then the following patch may be better because it leaves other cases
untouched (I'm not saying that we should or should not do it though)
-- 8< --
diff --git a/builtin/config.c b/builtin/config.c
index 8cd08da..d048ebf 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -199,8 +199,10 @@ static int get_value(const char *key_, const char *regex_)
goto free_strings;
}
} else {
- if (git_config_parse_key(key_, &key, NULL))
+ if (git_config_parse_key(key_, &key, NULL)) {
+ ret = 1;
goto free_strings;
+ }
}
if (regex_) {
-- 8< --
--
Duy
next prev parent reply other threads:[~2012-07-28 13:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-28 11:42 [PATCH] buitin_config: return postitive status in get_value Nikolai Vladimirov
2012-07-28 12:59 ` Nguyen Thai Ngoc Duy
2012-07-28 13:18 ` Nikolay Vladimirov
2012-07-28 13:29 ` Nguyen Thai Ngoc Duy [this message]
2012-07-29 6:38 ` Junio C Hamano
2012-07-29 20:43 ` Junio C Hamano
2012-07-29 21:41 ` Jeff King
2012-07-30 12:26 ` Nguyen Thai Ngoc Duy
2012-07-30 15:51 ` Junio C Hamano
2012-07-29 21:39 ` Jeff King
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=20120728132923.GA31388@do \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
--cc=nikolay@vladimiroff.com \
/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;
as well as URLs for NNTP newsgroup(s).