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
Stefan Beller <sbeller@google.com>
Date
Jun 24, 2017, 00:16 UTC
Message-ID
<CAGZ79kaoXf0=Zk6KQPrYMLsdqmqz+v2KitJwsPTiKJsiJ3fTLg@mail.gmail.com>
In-Reply-To
<871sqajrgi.fsf@gmail.com>
Show 28 quoted lines
> 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?

Previous: Junio C Hamano
Message 12 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.