Re: [PATCH] buitin_config: return postitive status in get_value
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Jul 28, 2012, 12:59 UTC
- Message-ID
- <CACsJy8BUU13H1tRfTtUme_7u0Jf0upca31U-VNhXva_0R2MLoQ@mail.gmail.com>
- In-Reply-To
- <1343475730-18743-1-git-send-email-nikolay@vladimiroff.com>
On Sat, Jul 28, 2012 at 6:42 PM, Nikolai Vladimirov <nikolay@vladimiroff.com> wrote:
Show 5 quoted lines
> 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.
I'm curious. Why is -1 (or 255) wrong? It was introduced in the first version of get_value in 4ddba79 (git-config-set: add more options - 2005-11-20). Back then it returned -1 when there's regex compile error to distinguish with 0 and 1 (but git-config-set.txt in the same commit did not get update about exit code). Maybe we should update document instead of the code.
-- Duy