# Potentially misleading color.* defaults explanation in git-config(1)

3 messages from 2016-09-16 to 2016-09-17. Participants: Anatoly Borodin, Matthieu Moy.
Thread: https://gitlist.dev/t/44096

## Anatoly Borodin, 2016-09-16 01:40

Subject: Potentially misleading color.* defaults explanation in git-config(1)
Message-ID: <nrfihd$a4o$1@blaine.gmane.org>
URL: https://gitlist.dev/e/nrfihd%24a4o%241%40blaine.gmane.org

```
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


```

## Matthieu Moy, 2016-09-16 07:25

Subject: Re: Potentially misleading color.* defaults explanation in git-config(1)
Message-ID: <vpqeg4k1f3g.fsf@anie.imag.fr>
URL: https://gitlist.dev/e/vpqeg4k1f3g.fsf%40anie.imag.fr
In-Reply-To: <nrfihd$a4o$1@blaine.gmane.org>

```
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/

```

## Anatoly Borodin, 2016-09-17 08:16

Subject: Re: Potentially misleading color.* defaults explanation in git-config(1)
Message-ID: <nriu5n$uss$1@blaine.gmane.org>
URL: https://gitlist.dev/e/nriu5n%24uss%241%40blaine.gmane.org
In-Reply-To: <vpqeg4k1f3g.fsf@anie.imag.fr>

```
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


```
