git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: What's cooking in git.git (Jun 2017, #06; Thu, 22)

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 24, 2017, 00:33 UTC
Message-ID
<xmqqa84yb4x7.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<871sqajrgi.fsf@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 20 quoted lines
> 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.

Previous: Stefan BellerNext: Stefan Beller
Message 11 of 12 in “What's cooking in git.git (Jun 2017, #06; Thu, 22)”
  1. Junio C HamanoJun 22, 2017
  2. Ævar Arnfjörð BjarmasonJun 22, 2017
  3. Junio C HamanoJun 23, 2017
  4. Junio C HamanoJun 24, 2017
  5. Lars SchneiderJun 23, 2017
  6. Ævar Arnfjörð BjarmasonJun 23, 2017
  7. Stefan BellerJun 23, 2017
  8. Junio C HamanoJun 24, 2017
  9. Junio C HamanoJun 24, 2017
  10. Stefan BellerJun 27, 2017
  11. Junio C HamanoJun 24, 2017
  12. Stefan BellerJun 24, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.