* [PATCH] doc: Fix specification of default (auto) for --color
@ 2017-12-20 13:14 William Pursell
2017-12-20 13:23 ` Jeff King
0 siblings, 1 reply; 2+ messages in thread
From: William Pursell @ 2017-12-20 13:14 UTC (permalink / raw)
To: git
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".
Signed-off-by: William Pursell <william.r.pursell@gmail.com>
---
Documentation/git-branch.txt | 2 +-
Documentation/git-grep.txt | 2 +-
Documentation/git-show-branch.txt | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt
index b3084c99c..1e4dc3d91 100644
--- a/Documentation/git-branch.txt
+++ b/Documentation/git-branch.txt
@@ -128,7 +128,7 @@ OPTIONS
--color[=<when>]::
Color branches to highlight current, local, and
remote-tracking branches.
- The value must be always (the default), never, or auto.
+ The value must be always, never, or auto (the default).
--no-color::
Turn off branch colors, even when the configuration file gives the
diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt
index 18b494731..cb62fa30e 100644
--- a/Documentation/git-grep.txt
+++ b/Documentation/git-grep.txt
@@ -201,7 +201,7 @@ providing this option will cause it to die.
--color[=<when>]::
Show colored matches.
- The value must be always (the default), never, or auto.
+ The value must be always, never, or auto (the default).
--no-color::
Turn off match highlighting, even when the configuration file
diff --git a/Documentation/git-show-branch.txt
b/Documentation/git-show-branch.txt
index 7818e0f09..4a7be5f0c 100644
--- a/Documentation/git-show-branch.txt
+++ b/Documentation/git-show-branch.txt
@@ -119,7 +119,7 @@ OPTIONS
--color[=<when>]::
Color the status sign (one of these: `*` `!` `+` `-`) of each commit
corresponding to the branch it's in.
- The value must be always (the default), never, or auto.
+ The value must be always, never, or auto (the default).
--no-color::
Turn off colored output, even when the configuration file gives the
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] doc: Fix specification of default (auto) for --color
2017-12-20 13:14 [PATCH] doc: Fix specification of default (auto) for --color William Pursell
@ 2017-12-20 13:23 ` Jeff King
0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2017-12-20 13:23 UTC (permalink / raw)
To: William Pursell; +Cc: git
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-12-20 13:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-20 13:14 [PATCH] doc: Fix specification of default (auto) for --color William Pursell
2017-12-20 13:23 ` Jeff King
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).