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

Re: [PATCH 1/4] config doc: move color.ui documentation to one place

From
Jeff King <peff@peff.net>
Date
May 31, 2018, 05:25 UTC
Message-ID
<20180531052538.GB17068@sigill.intra.peff.net>
In-Reply-To
<20180530210641.19771-2-avarab@gmail.com>
On Wed, May 30, 2018 at 09:06:38PM +0000, Ævar Arnfjörð Bjarmason wrote:
Show 8 quoted lines
> Ever since b982592d66 ("git-status: document colorization config
> options", 2006-09-11) we've slowly been accumulating more and more
> color.* options, where the documentation for each new one has
> seemingly been copy/pasted with minor adjustments from the last.
> 
> This has resulted in documentation where we're describing what sort of
> values color.ui or its overriding variables can take a grand total of
> 9 times.
Yeah, I agree the current state is poor.
Show 7 quoted lines
> This makes for hard and tedious reading, and is going to be a royal
> pain if we're ever going to add more color.ui values.
> 
> Instead let's briefly describe what each variable is for, and then
> copy/paste a new boilerplate saying that this variable takes the exact
> same values as color.ui, and if it's unset it'll fallback to whatever
> color.ui is set to.

Definitely an improvement. Though I wonder if we should go further and show the user the relationship in the documentation explicitly. Like:

  color.<system>::
	A boolean to enable/disable color in a particular part of Git,
	overriding `color.ui` (see `color.ui` for possible values). The
	current set of systems is:
	advice::
		Hints shown with the "hint:" prefix, controlled by
		`advice.*` config.
	branch::
		Output from the linkgit:git-branch[1] command.
	...etc...

We could possibly do the same with color.<system>.<slot>. Or maybe even make a single hierarchical list of systems, and then the color slots under each. I think if our mental model in adding these options is to have this kind of hierarchy, then it makes sense to communicate it explicitly to the user and get them using the same mental model.

-Peff
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 10 of 18 in “color.ui docs & add color.ui=isatty”
  1. 0/4 color.ui docs & add color.ui=isattyÆvar Arnfjörð Bjarmason, May 30, 2018
  2. 2/4 config doc: clarify "to a terminal" in color.uiÆvar Arnfjörð Bjarmason, May 30, 2018
  3. Jeff KingMay 31, 2018
  4. 3/4 color.ui config: don't die on unknown valuesÆvar Arnfjörð Bjarmason, May 30, 2018
  5. Stefan BellerMay 30, 2018
  6. Junio C HamanoMay 30, 2018
  7. Ævar Arnfjörð BjarmasonMay 31, 2018
  8. Jeff KingJun 1, 2018
  9. 1/4 config doc: move color.ui documentation to one placeÆvar Arnfjörð Bjarmason, May 30, 2018
  10. Jeff KingMay 31, 2018
  11. Ævar Arnfjörð BjarmasonMay 31, 2018
  12. Jeff KingJun 1, 2018
  13. 4/4 color.ui config: add "isatty" settingÆvar Arnfjörð Bjarmason, May 30, 2018
  14. Junio C HamanoMay 30, 2018
  15. Ævar Arnfjörð BjarmasonMay 31, 2018
  16. Jeff KingMay 31, 2018
  17. Ævar Arnfjörð BjarmasonMay 31, 2018
  18. Jeff KingJun 1, 2018

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.