git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Keeping <john@keeping.me.uk>
To: git@vger.kernel.org
Cc: John Keeping <john@keeping.me.uk>, Guilherme <guibufolo@gmail.com>
Subject: [PATCH 0/3] Re: git config --get-urlmatch does not set exit code 1 when no match is found
Date: Sun, 28 Feb 2016 11:54:34 +0000	[thread overview]
Message-ID: <cover.1456660027.git.john@keeping.me.uk> (raw)
In-Reply-To: <20160228104557.GT1766@serenity.lan>

On Sun, Feb 28, 2016 at 10:45:57AM +0000, John Keeping wrote:
> It looks to me like a simple bug that --get-urlmatch doesn't return 1 if
> the key isn't found, but git-config(1) isn't entirely clear.  The
> overall documentation on exit codes at the end of DESCRIPTION says that
> exit code 1 means:
> 
>       the section or key is invalid (ret=1)
> 
> Then the documentation for the --get option says:
> 
>       Returns error code 1 if the key was not found.
> 
> and --get-all says:
> 
>       Like get, but does not fail if the number of values for the key
>       is not exactly one.
> 
> although it does return 1 if there are zero values.  --get-regexp
> behaves in the same way.
> 
> Overall I think that the fact that --get-urlmatch is the outlier here
> means that it should change to match the other --get* options (ignoring
> --get-color and --get-colorbool which are very different).  Although I
> wonder if anyone is relying on the current behaviour and will find their
> workflow broken if we change this.
> 
> The documentation could also use some clarification since most of the
> return codes only apply for the "set" options and in some cases this
> isn't clear from the existing descriptions.

Here's a series that changes the behaviour of "git config --get-urlmatch"
when no appropriate key is found as well as a couple of improvements to
the documentation while we're here.

The second two patches are independent of the first and I think they
should be picked up even if we decide the change to --get-urlmatch's
exit code is not desirable.

John Keeping (3):
  config: fail if --get-urlmatch finds no value
  Documentation/git-config: use bulleted list for exit codes
  Documentation/git-config: fix --get-all description

 Documentation/git-config.txt | 19 +++++++++----------
 builtin/config.c             |  5 ++++-
 t/t1300-repo-config.sh       |  3 +++
 3 files changed, 16 insertions(+), 11 deletions(-)

-- 
2.7.1.503.g3cfa3ac

  parent reply	other threads:[~2016-02-28 11:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-28  4:39 git config --get-urlmatch does not set exit code 1 when no match is found Guilherme
2016-02-28 10:45 ` John Keeping
2016-02-28 11:52   ` John Keeping
2016-02-28 11:54   ` John Keeping [this message]
2016-02-28 20:01     ` [PATCH 0/3] " Junio C Hamano
2016-02-28 11:54   ` [PATCH 1/3] config: fail if --get-urlmatch finds no value John Keeping
2016-02-28 11:54   ` [PATCH 2/3] Documentation/git-config: use bulleted list for exit codes John Keeping
2016-02-28 11:54   ` [PATCH 3/3] Documentation/git-config: fix --get-all description John Keeping
2016-02-29 11:53 ` git config --get-urlmatch does not set exit code 1 when no match is found Jeff King
2016-02-29 13:08   ` Guilherme
2016-03-01 15:03     ` 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=cover.1456660027.git.john@keeping.me.uk \
    --to=john@keeping.me.uk \
    --cc=git@vger.kernel.org \
    --cc=guibufolo@gmail.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).