Skip to contentSkip to conversation

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

DISCUSSION Daniel Villeneuve 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 8 lines · Daniel Villeneuve

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

#2 lore raw
Quoted 10 lines · Jeff King
Quoted 8 lines · Daniel Villeneuve

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"?

Quoted 8 lines

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