git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Stefan Beller <sbeller@google.com>
Subject: Re: What's cooking in git.git (Jun 2017, #06; Thu, 22)
Date: Fri, 23 Jun 2017 17:33:24 -0700	[thread overview]
Message-ID: <xmqqa84yb4x7.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <871sqajrgi.fsf@gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Fri, 23 Jun 2017 23:59:25 +0200")

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> This is bad:
>
>     $ ./git --exec-path=$PWD -c diff.colorMoved=crap show
>     fatal: unable to parse 'diff.colormoved' from command-line config
>
> Fixed with:
>
>     diff --git a/diff.c b/diff.c
>     index 7cae4f1ddb..036dbc1c3c 100644
>     --- a/diff.c
>     +++ b/diff.c
>     @@ -278,7 +278,7 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
>             if (!strcmp(var, "diff.colormoved")) {
>                     int cm = parse_color_moved(value);
>                     if (cm < 0)
>     -                       return -1;
>     +                       die("bad --color-moved argument: %s", value);
>                     diff_color_moved_default = cm;
>                     return 0;
>             }

You would want to model this after an existing practice nearby.

    $ git -c color.diff.new=frotz diff
    error: error: invalid color value: frotz
    fatal: unable to parse 'color.diff.new' from command-line config

It could be argued that it would even be better to show "here is the
list of valid values the configuration takes", but generally we do
not do that in other configuration variables.

      parent reply	other threads:[~2017-06-24  0:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-22 22:35 What's cooking in git.git (Jun 2017, #06; Thu, 22) Junio C Hamano
2017-06-22 22:58 ` Ævar Arnfjörð Bjarmason
2017-06-23  5:28   ` Junio C Hamano
2017-06-24  0:27     ` Junio C Hamano
2017-06-23  9:43 ` Lars Schneider
2017-06-23 21:59 ` Ævar Arnfjörð Bjarmason
2017-06-23 23:39   ` Stefan Beller
2017-06-24  0:37     ` Junio C Hamano
2017-06-24  1:01       ` Junio C Hamano
2017-06-27  2:58         ` Stefan Beller
2017-06-24  0:16   ` Stefan Beller
2017-06-24  0:33   ` Junio C Hamano [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqa84yb4x7.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sbeller@google.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).