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

Re: [PATCH] doc: Fix specification of default (auto) for --color

From
Jeff King <peff@peff.net>
Date
Dec 20, 2017, 13:23 UTC
Message-ID
<20171220132335.GE17569@sigill.intra.peff.net>
In-Reply-To
<CAJPQ5Na1Z5QpgqS+wUVPGq-E+wOgsW5m4NzGEUcAnmDnRz+9DA@mail.gmail.com>
On Wed, Dec 20, 2017 at 05:14:02AM -0800, William Pursell wrote:
Show 7 quoted lines
> Current documentation for branch, show-branch, and grep contain the following:
> 
> --color[=<when>]
>            Show colored matches. The value must be always (the
> default), never, or auto.
> 
> This is incorrect, as the default is "auto".

I think what this is trying to say is that if you specify "--color" but not "<when>", then "<when>" defaults to "always". I.e., this is talking about a different default than if you didn't specify "--color" at all (and that default relies on the config, which in turn defaults to "auto").

The wording is quite confusing, though. Maybe we could clarify that and mention both "defaults":

  --color[=<when>]
	Show colored matches. The value of `<when>` must be `always`,
	`never`, or `auto`. If `<when>` is omitted (i.e., just
	`--color`), behave as if `--color=always` was specified. If no
	`--color` option is given, defaults, to the value of the
	`color.grep` config variable.
There may be a less clunky way of saying all that, though.
-Peff
Previous: William Pursell
Message 2 of 2 in “doc: Fix specification of default (auto) for --color”
  1. doc: Fix specification of default (auto) for --colorWilliam Pursell, Dec 20, 2017
  2. Jeff KingDec 20, 2017

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.