Thread (1 message) 1 message, 1 author, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:50:27

Matthieu Moy [off-list ref] writes:
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.
Overall I agree with the above observation, but the original poster says
"redirecting into a _file_".

Another possibility is that the mysterious platform the original poster
did not mention has a broken istty() that mistakes a file descriptor going
to a file (instead of a pipe to another process) as connected to a tty.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help