git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: William Pursell <william.r.pursell@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] doc: Fix specification of default (auto) for --color
Date: Wed, 20 Dec 2017 08:23:35 -0500	[thread overview]
Message-ID: <20171220132335.GE17569@sigill.intra.peff.net> (raw)
In-Reply-To: <CAJPQ5Na1Z5QpgqS+wUVPGq-E+wOgsW5m4NzGEUcAnmDnRz+9DA@mail.gmail.com>

On Wed, Dec 20, 2017 at 05:14:02AM -0800, William Pursell wrote:

> 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

      reply	other threads:[~2017-12-20 13:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-20 13:14 [PATCH] doc: Fix specification of default (auto) for --color William Pursell
2017-12-20 13:23 ` Jeff King [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171220132335.GE17569@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=william.r.pursell@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.
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 NNTP newsgroup(s).