From: Stefan Beller <sbeller@google.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: What's cooking in git.git (Jun 2017, #06; Thu, 22)
Date: Fri, 23 Jun 2017 17:16:06 -0700 [thread overview]
Message-ID: <CAGZ79kaoXf0=Zk6KQPrYMLsdqmqz+v2KitJwsPTiKJsiJ3fTLg@mail.gmail.com> (raw)
In-Reply-To: <871sqajrgi.fsf@gmail.com>
> This is good:
>
> $ ./git --exec-path=$PWD show --color-moved=crap
> fatal: bad --color-moved argument: crap
>
> 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;
> }
>
> But I'm not familiar enough with the code to say if just dying here, as
> opposed to returning -1 is OK or not.
I think this one is 'not good', as it (a) does not help the user a lot
and (b) is not consistent with the rest around in that function, for example
$ git -c diff.interhunkcontext=-2 diff
fatal: unable to parse 'diff.interhunkcontext' from command-line config
So instead of return -1, we could issue an additional warning, but this could
be a generic warning?
next prev parent reply other threads:[~2017-06-24 0:16 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 [this message]
2017-06-24 0:33 ` Junio C Hamano
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='CAGZ79kaoXf0=Zk6KQPrYMLsdqmqz+v2KitJwsPTiKJsiJ3fTLg@mail.gmail.com' \
--to=sbeller@google.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).