git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Cc: Johannes Sixt <j6t@kdbg.org>, Sascha Peilicke <saschpe@gmx.de>,
	git@vger.kernel.org
Subject: Re: [PATCH] No color diff when redirecting to file
Date: Sun, 23 Jan 2011 15:32:12 -0800	[thread overview]
Message-ID: <7voc77mc1v.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <vpq39oj4jfz.fsf@bauges.imag.fr> (Matthieu Moy's message of "Sun\, 23 Jan 2011 18\:29\:52 +0100")

Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:

> Johannes Sixt <j6t@kdbg.org> 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.

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.

  reply	other threads:[~2011-01-23 23:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-23 13:10 [PATCH] No color diff when redirecting to file Sascha Peilicke
2011-01-23 14:47 ` Johannes Sixt
2011-01-23 17:29   ` Matthieu Moy
2011-01-23 23:32     ` Junio C Hamano [this message]
2011-01-24  8:59     ` Sascha Peilicke
2011-01-24  9:38       ` Matthieu Moy
2011-01-24  8:56   ` Sascha Peilicke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7voc77mc1v.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Matthieu.Moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=saschpe@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).