All of lore.kernel.org
 help / color / mirror / Atom feed
* Potentially misleading color.* defaults explanation in git-config(1)
@ 2016-09-16  1:40 Anatoly Borodin
  2016-09-16  7:25 ` Matthieu Moy
  0 siblings, 1 reply; 3+ messages in thread
From: Anatoly Borodin @ 2016-09-16  1:40 UTC (permalink / raw)
  To: git

Hi All!

git-config(1) says:

       color.branch
           A boolean to enable/disable color in the output of git-branch(1).
           May be set to always, false (or never) or auto (or true), in which
           case colors are used only when the output is to a terminal.
           Defaults to false.

If the value false is the default, and neither color.branch nor
color.ui is set in any config file, one can expect that

(1)	git branch

and

(2)	git config color.branch false ; git branch

produce the same result. But only (2) produces colorless output, (1)
uses colors (that probably depend on the default value of color.ui).

The same story with color.diff and git-show, color.grep, etc.

Is it me being a non-native English speaker, or does this part really
need to be rewritten?

PS git version 2.9.3

-- 
Mit freundlichen Grüßen,
Anatoly Borodin


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Potentially misleading color.* defaults explanation in git-config(1)
  2016-09-16  1:40 Potentially misleading color.* defaults explanation in git-config(1) Anatoly Borodin
@ 2016-09-16  7:25 ` Matthieu Moy
  2016-09-17  8:16   ` Anatoly Borodin
  0 siblings, 1 reply; 3+ messages in thread
From: Matthieu Moy @ 2016-09-16  7:25 UTC (permalink / raw)
  To: Anatoly Borodin; +Cc: git

Anatoly Borodin <anatoly.borodin@gmail.com> writes:

> Hi All!
>
> git-config(1) says:
>
>        color.branch
>            A boolean to enable/disable color in the output of git-branch(1).
>            May be set to always, false (or never) or auto (or true), in which
>            case colors are used only when the output is to a terminal.

So far, so good.

>            Defaults to false.

The truth is: Defaults to following color.ui, which used to default to
false but now defaults to auto.

My bad, I forgot to update these parts of the docs when changing the
default for color.ui (a while back already). Patch follows.

> (2)	git config color.branch false ; git branch

Unrelated from the question, but you could write

git -c color.branch=false git branch

to set a configuration value just for one command.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Potentially misleading color.* defaults explanation in git-config(1)
  2016-09-16  7:25 ` Matthieu Moy
@ 2016-09-17  8:16   ` Anatoly Borodin
  0 siblings, 0 replies; 3+ messages in thread
From: Anatoly Borodin @ 2016-09-17  8:16 UTC (permalink / raw)
  To: git

Hi!

Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
> My bad, I forgot to update these parts of the docs when changing the
> default for color.ui (a while back already). Patch follows.

Thanks for the patch!

> git -c color.branch=false git branch

Oh, that's a nice one! I don't get a chance to use those
between-git-and-command options often.

Merci!

-- 
Mit freundlichen Grüßen,
Anatoly Borodin


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-17  8:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-16  1:40 Potentially misleading color.* defaults explanation in git-config(1) Anatoly Borodin
2016-09-16  7:25 ` Matthieu Moy
2016-09-17  8:16   ` Anatoly Borodin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.