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

Re: ["BUG"] builtin add-interactive does not honor 'color.diff. frag'

From
Jeff King <peff@peff.net>
Date
Nov 10, 2020, 18:01 UTC
Message-ID
<20201110180151.GA1362803@coredump.intra.peff.net>
In-Reply-To
<nycvar.QRO.7.76.6.2011101653330.18437@tvgsbejvaqbjf.bet>
On Tue, Nov 10, 2020 at 05:06:59PM +0100, Johannes Schindelin wrote:
Show 12 quoted lines
> > but that is missing another thing: for historical reasons we allow both
> > color.diff.frag and diff.color.frag. TBH, I wouldn't be too sad to see
> > us drop support for the historical versions in this setting. But it
> > makes me wonder if we could be reusing the parsing from
> > git_diff_basic_config(), which handles both cases.
> 
> Hmm. The Perl version uses the Git.pm's `get_color()` function, which in
> turn invokes `git config --get-color` with the exact keys I pasted above.
> 
> All along the way to `builtin/config.c`'s `git_get_color_config()`, I fail
> to see any `color.diff`/`diff.color` munging. So I believe that `git add
> --interactive` _never_ looked at the `diff.color` section to begin with.

Yeah, I think you're right. And I'm not too surprised. The same "I wouldn't be too sad" probably applied back then, too.

Yep: https://lore.kernel.org/git/20071122122540.GH12913@sigill.intra.peff.net/
Show 12 quoted lines
> > I'm not entirely clear on how add-interactive.c invokes the diff, and
> > whether it would be unhappy to pick up diff config. But it seems like
> > this:
> [...]
> 
> Hmm. I don't like it. So far, we were very careful to keep respecting
> `struct repository *r` in the built-in interactive add command. This would
> go the exact opposite way.
> 
> Combined with the fact that we never supported `diff.color.*` in the
> interactive add command anyway, I would rather continue with the first
> variant you presented.
Yeah, that seems quite sensible to me.
-Peff
Previous: Johannes SchindelinNext: Jeff King
Message 4 of 8 in “["BUG"] builtin add-interactive does not honor 'color.diff. frag'”
  1. Philippe BlainNov 6, 2020
  2. Jeff KingNov 6, 2020
  3. Johannes SchindelinNov 10, 2020
  4. Jeff KingNov 10, 2020
  5. add-interactive.c: use correct names to load color.diff.* configJeff King, Nov 10, 2020
  6. Johannes SchindelinNov 10, 2020
  7. Jeff KingNov 10, 2020
  8. Johannes SchindelinNov 10, 2020

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.