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

Re: [PATCH/RFC] ignore unknown color configuration

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 12, 2009, 21:45 UTC
Message-ID
<7vzl5nn9x2.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20091212122524.GA17547@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> When parsing the config file, if there is a value that is
> syntactically correct but unused, we generally ignore it.
> This lets non-core porcelains store arbitrary information in
> the config file, and it means that configuration files can
> be shared between new and old versions of git (the old
> versions might simply ignore certain configuration).
>
> The one exception to this is color configuration; if we
> encounter a color.{diff,branch,status}.$slot variable, we
> die if it is not one of the recognized slots (presumably as
> a safety valve for user misconfiguration).

This reminds me of the issue an earlier patch with a good intention but a horrible consequence wanted to address.

  http://thread.gmane.org/gmane.comp.version-control.git/125925/focus=127629
> This patch loosens the check to match the rest of
> git-config; unknown color slots are simply ignored.

I am of two minds, even though I am slightly in favor than against the change.

This is a sane thing to do, as "slot" is part of the name of the variable, and we generally do not warn upon seeing a misspelled variable name (it makes it worse that "func" is not even misspelled but merely unknown to older version of git in your scenario).

On the other hand, I suspect that most people would apprecfiate if their git pointed out "diff.color.finc? What do you mean?" before they waste 30 minutes wondering why the new feature in 1.6.6 does not work for them.

Previous: Jeff KingNext: Jeff King
Message 2 of 8 in “ignore unknown color configuration”
  1. ignore unknown color configurationJeff King, Dec 12, 2009
  2. Junio C HamanoDec 12, 2009
  3. Jeff KingDec 12, 2009
  4. Junio C HamanoDec 14, 2009
  5. Junio C HamanoDec 16, 2009
  6. Jeff KingDec 16, 2009
  7. Junio C HamanoDec 16, 2009
  8. Jeff KingDec 16, 2009

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.