From: Angelo Borsotti <angelo.borsotti@gmail.com>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: Ben Walton <bdwalton@gmail.com>, git <git@vger.kernel.org>
Subject: Re: git config error message
Date: Sat, 27 Oct 2012 16:50:32 +0200 [thread overview]
Message-ID: <CAB9Jk9A-uXXXKCBKvxyDN6QQx1b0zqemg7UbeRMcWeY7gi4MRQ@mail.gmail.com> (raw)
In-Reply-To: <m2d3049hvs.fsf@igel.home>
Hi Andreas,
>
> Is grep not finding a match an error? Is cmp finding a difference an
> error? It all depends on the context.
>
Manpage of grep, exit staus:
"Normally, the exit status is 0 if selected lines are found and 1
otherwise. But the exit status is 2 if an error occurred, ..."
cmp uses the same convention (albeit not reported in its manpage).
I am not stating that all linux commands and utilities follow exactly
the same convention, but these
two are at least consistent with themselves always returning an exit
status that has a well defined meaning. git-config returns
consistently the exit status, it only issues in certain cases messages
and in others not. A consistent solution could be for it to return 0
upon success, 1 when the section or key is absent, and 2 when the
config file does not exist or is corrupt issuing also an error
message.
-Angelo
>> How can otherwise the user tell a corrupted configuration file from a
>> missing key?
>
> You cannot, as long as your configuration file is well-formed, because a
> missing key is an expected condition in many cases.
>
> Andreas.
>
> --
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
next prev parent reply other threads:[~2012-10-27 14:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-27 8:10 git config error message Angelo Borsotti
2012-10-27 8:25 ` Andreas Schwab
2012-10-27 8:32 ` Angelo Borsotti
2012-10-27 8:44 ` Andreas Schwab
2012-10-27 8:45 ` Ben Walton
2012-10-27 10:36 ` Angelo Borsotti
2012-10-27 13:14 ` Andreas Schwab
2012-10-27 14:50 ` Angelo Borsotti [this message]
2012-10-27 16:12 ` Andreas Schwab
-- strict thread matches above, loose matches on Subject: below --
2007-11-12 15:35 Jon Smirl
2007-11-12 22:23 ` Alex Riesen
2007-11-12 22:24 ` Johannes Schindelin
2007-11-12 22:26 ` Alex Riesen
2007-11-12 23:09 ` Jakub Narebski
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=CAB9Jk9A-uXXXKCBKvxyDN6QQx1b0zqemg7UbeRMcWeY7gi4MRQ@mail.gmail.com \
--to=angelo.borsotti@gmail.com \
--cc=bdwalton@gmail.com \
--cc=git@vger.kernel.org \
--cc=schwab@linux-m68k.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;
as well as URLs for NNTP newsgroup(s).