Re: [PATCH] No color diff when redirecting to file

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

Re: [PATCH] No color diff when redirecting to file

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:50:27

Johannes Sixt [off-list ref] writes:
That said, I cannot reproduce. Perhaps your configuration says 
color.ui=always? If so, then this is expected behavior and not a bug, IMO.
I think you're right.

I tested this (without the patch):

git diff
=> I get color, because I have color.ui = auto

git diff | cat
=> I don't get color

git diff --color=auto | cat
=> no color

git diff --color=always | cat
=> colors, because I've asked

this seems to be just the right behavior.

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

Re: [PATCH] No color diff when redirecting to file

From: Sascha Peilicke <hidden>
Date: 2016-06-15 22:50:27

On Sunday 23 January 2011 18:29:52 you wrote:
Johannes Sixt [off-list ref] writes:
quoted
That said, I cannot reproduce. Perhaps your configuration says
color.ui=always? If so, then this is expected behavior and not a bug,
IMO.
I think you're right.

I tested this (without the patch):

git diff
=> I get color, because I have color.ui = auto

git diff | cat
=> I don't get color

git diff --color=auto | cat
=> no color

git diff --color=always | cat
=> colors, because I've asked

this seems to be just the right behavior.
try the same with

git diff > foo

works when

git diff --no-color > foo
-- 
Mit freundlichen Grüßen,
Sascha Peilicke
http://saschpe.wordpress.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help