Re: [PATCH] buitin_config: return postitive status in get_value

2012-07-30 Thread Junio C Hamano
Nguyen Thai Ngoc Duy writes: > On Mon, Jul 30, 2012 at 3:43 AM, Junio C Hamano wrote: >> +. You use '--global' option without $HOME being properly set (ret=128), >> +. Any other errors (ret=7). > > To be pedantic, ret=128 is a result of die() and not setting $HOME is > just one of them. There's

Re: [PATCH] buitin_config: return postitive status in get_value

2012-07-30 Thread Nguyen Thai Ngoc Duy
On Mon, Jul 30, 2012 at 3:43 AM, Junio C Hamano wrote: > +. You use '--global' option without $HOME being properly set (ret=128), > +. Any other errors (ret=7). To be pedantic, ret=128 is a result of die() and not setting $HOME is just one of them. There's also ret=129 for usage(), which is not d

Re: [PATCH] buitin_config: return postitive status in get_value

2012-07-29 Thread Jeff King
On Sun, Jul 29, 2012 at 01:43:21PM -0700, Junio C Hamano wrote: > > But if we really want to follow that "documented" subset of possible > > conditions, I agree that your version to return "1" in this case, > > together with a change to initialize "ret" to "7" and document it as > > "all other err

Re: [PATCH] buitin_config: return postitive status in get_value

2012-07-29 Thread Jeff King
On Sat, Jul 28, 2012 at 11:38:10PM -0700, Junio C Hamano wrote: > > 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) > > I personally think that the documentation unnecessarily exposes the > useless value

Re: [PATCH] buitin_config: return postitive status in get_value

2012-07-29 Thread Junio C Hamano
Junio C Hamano writes: > I personally think that the documentation unnecessarily exposes the > useless value assignment of the exit codes (the use of different > exit codes was done merely to aid debugging the git-config command > itself) by describing the then-current set of conditions, and shou

Re: [PATCH] buitin_config: return postitive status in get_value

2012-07-28 Thread Junio C Hamano
Nguyen Thai Ngoc Duy writes: > 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

Re: [PATCH] buitin_config: return postitive status in get_value

2012-07-28 Thread Nguyen Thai Ngoc Duy
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

Re: [PATCH] buitin_config: return postitive status in get_value

2012-07-28 Thread Nguyen Thai Ngoc Duy
On Sat, Jul 28, 2012 at 6:42 PM, Nikolai Vladimirov wrote: > Returning -1 instead of 1 results in wrong exit status(255) since > the output of get_value is passed to exit(). > > 'git config missing_section' should now return proper exit status = 1, > as specified by the git config documentation.

[PATCH] buitin_config: return postitive status in get_value

2012-07-28 Thread Nikolai Vladimirov
Returning -1 instead of 1 results in wrong exit status(255) since the output of get_value is passed to exit(). 'git config missing_section' should now return proper exit status = 1, as specified by the git config documentation. Signed-off-by: Nikolai Vladimirov --- builtin/config.c | 2 +- 1 fi