# git -c var=val not taken into account by git config?

3 messages from 2012-05-07 to 2012-05-08. Participants: Daniel Villeneuve, Jeff King.
Thread: https://gitlist.dev/t/30462

## Daniel Villeneuve, 2012-05-07 23:16

Subject: git -c var=val not taken into account by git config?
Message-ID: <4FA857E3.5030609@videotron.ca>
URL: https://gitlist.dev/e/4FA857E3.5030609%40videotron.ca

```
Hi,

Testing color configuration via scripting, I tried the following command:

git -c color.diff=always config --get-colorbool diff false

on a repository with color.diff=auto.

I'd expect "true" as output, but got "false".  "git diff" works as 
expected though.  Is this an exception for "git config"?

Using git version 1.7.10.1.
--
Daniel Villeneuve

```

## Jeff King, 2012-05-08 09:16

Subject: Re: git -c var=val not taken into account by git config?
Message-ID: <20120508091606.GB31286@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20120508091606.GB31286%40sigill.intra.peff.net
In-Reply-To: <4FA857E3.5030609@videotron.ca>

```
On Mon, May 07, 2012 at 07:16:51PM -0400, Daniel Villeneuve wrote:

> Testing color configuration via scripting, I tried the following command:
> 
> git -c color.diff=always config --get-colorbool diff false
> 
> on a repository with color.diff=auto.
> 
> I'd expect "true" as output, but got "false".  "git diff" works as
> expected though.  Is this an exception for "git config"?

I think you meant "--get-colorbool color.diff"; the fact that you are
getting a colorbool does not automatically place the name inside the
color.* section.

With that change, it seems to work as expected.

-Peff

```

## Daniel Villeneuve, 2012-05-08 12:56

Subject: Re: git -c var=val not taken into account by git config?
Message-ID: <4FA91819.20301@videotron.ca>
URL: https://gitlist.dev/e/4FA91819.20301%40videotron.ca
In-Reply-To: <20120508091606.GB31286@sigill.intra.peff.net>

```
On 08/05/12 05:16 AM, Jeff King wrote:
> On Mon, May 07, 2012 at 07:16:51PM -0400, Daniel Villeneuve wrote:
>
>> Testing color configuration via scripting, I tried the following command:
>>
>> git -c color.diff=always config --get-colorbool diff false
>>
>> on a repository with color.diff=auto.
>>
>> I'd expect "true" as output, but got "false".  "git diff" works as
>> expected though.  Is this an exception for "git config"?
> I think you meant "--get-colorbool color.diff"; the fact that you are
> getting a colorbool does not automatically place the name inside the
> color.* section.
>
> With that change, it seems to work as expected.
>
> -Peff
>
Indeed, and the example was mentioning "color.diff".  My error.  Giving 
just "diff", I was getting results from color.ui instead.

Regards,
--
Daniel

```
