git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Philippe Blain <levraiphilippeblain@gmail.com>,
	Git mailing list <git@vger.kernel.org>
Subject: Re: ["BUG"] builtin add-interactive does not honor 'color.diff. frag'
Date: Tue, 10 Nov 2020 13:01:51 -0500	[thread overview]
Message-ID: <20201110180151.GA1362803@coredump.intra.peff.net> (raw)
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:

> > 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/

> > 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

  reply	other threads:[~2020-11-10 18:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06 16:31 ["BUG"] builtin add-interactive does not honor 'color.diff. frag' Philippe Blain
2020-11-06 17:03 ` Jeff King
2020-11-10 16:06   ` Johannes Schindelin
2020-11-10 18:01     ` Jeff King [this message]
2020-11-10 18:28     ` [PATCH] add-interactive.c: use correct names to load color.diff.* config Jeff King
2020-11-10 19:17       ` Johannes Schindelin
2020-11-10 19:48         ` Jeff King
2020-11-10 22:30           ` Johannes Schindelin

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=20201110180151.GA1362803@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=levraiphilippeblain@gmail.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).