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

Re: [BUG] git-diff-* --color oddness

From
Jeff King <peff@peff.net>
Date
Jan 4, 2008, 08:43 UTC
Message-ID
<20080104084345.GA3472@coredump.intra.peff.net>
In-Reply-To
<7v63yam1i9.fsf@gitster.siamese.dyndns.org>
On Fri, Jan 04, 2008 at 12:35:42AM -0800, Junio C Hamano wrote:
Show 8 quoted lines
> What I meant is "git diff" without --color can be colorized
> because of config but we should never allow "git diff-files"
> without --color to be colorized by user's config.  I realize
> that you were talking about the choice of colors, which is a
> different issue.
> 
> I do not much care ;-), but I guess we would want to be
> consistent.

OK, yes, I knew that about diff.color already. But I think it is a bug to not use the user's colors in "git add -i", and I think the right fix is to make diff-files consistent in its color choices. Patch will follow.

> That one _is_ a bug.  diff-files should not be affected by
> "diff.color = auto" or somesuch in the config, even when the
> user uses custom function header crap.

It doesn't use it, actually, but I think that is a happy accident of the way most config options are used (i.e., we _do_ read and change the config, but we just never look at it again because we have done our diff_setup). If you could provoke any of the diff plumbing to call diff_setup twice, you would be in trouble (but even diff-tree --stdin doesn't do that).

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 12 in “[BUG] git-diff-* --color oddness”
  1. Jeff KingJan 4, 2008
  2. Junio C HamanoJan 4, 2008
  3. Jeff KingJan 4, 2008
  4. Junio C HamanoJan 4, 2008
  5. Jeff KingJan 4, 2008
  6. Junio C HamanoJan 4, 2008
  7. Jeff KingJan 4, 2008
  8. Junio C HamanoJan 4, 2008
  9. Jeff KingJan 4, 2008
  10. Jeff KingJan 4, 2008
  11. Junio C HamanoJan 4, 2008
  12. Jeff KingJan 4, 2008

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.