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

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Daniel Villeneuve <hidden>
Date: 2016-06-15 22:53:46

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

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

From: Jeff King <hidden>
Date: 2016-06-15 22:53:46

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

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

From: Daniel Villeneuve <hidden>
Date: 2016-06-15 22:53:46

On 08/05/12 05:16 AM, Jeff King wrote:
On Mon, May 07, 2012 at 07:16:51PM -0400, Daniel Villeneuve wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help