git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "Srb, Michal" <michal.srb11@imperial.ac.uk>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: FW: Git log --graph doesn't output color when redirected
Date: Thu, 13 Dec 2012 08:13:29 -0500	[thread overview]
Message-ID: <20121213131329.GA5042@sigill.intra.peff.net> (raw)
In-Reply-To: <72BB37CB88C48F4B925365539F1EE46C18261403@icexch-m3.ic.ac.uk>

On Wed, Dec 12, 2012 at 05:35:17PM +0000, Srb, Michal wrote:

> Unlike --pretty-format, --graph doesn’t output colors when the git log output
> is redirected.

I do not think it has anything to do with --graph in particular, but
rather that when colorization is set to the "auto" mode, it is enabled
only when stdout is a tty. Diff coloring, for example, follows the same
rules.  If you are using --format="%C(red)" or similar placeholders,
they are the odd duck by not respecting the auto-color mode.

> Is there a setting somewhere in config to change this?

Yes. If you use "--color" on the command line, that means
"unconditionally use color". If you set color.ui (or any other color
config option) to "always", then you will always get color (and you can
disable it for a particular run with "--no-color"). Setting a color
config option to "true" is the same as "auto", which gets you the auto
mode.

-Peff

  reply	other threads:[~2012-12-13 13:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <72BB37CB88C48F4B925365539F1EE46C182613A9@icexch-m3.ic.ac.uk>
2012-12-12 17:35 ` FW: Git log --graph doesn't output color when redirected Srb, Michal
2012-12-13 13:13   ` Jeff King [this message]
2012-12-13 15:34     ` Srb, Michal
2012-12-15  3:23     ` Nguyen Thai Ngoc Duy
2012-12-15 10:16       ` Jeff King
2012-12-15 18:30         ` Junio C Hamano
2012-12-17  8:40           ` [PATCH] log --format: teach %C(auto,black) to paint it black only on terminals Junio C Hamano
2012-12-17 11:44             ` Nguyen Thai Ngoc Duy
2012-12-17 12:13               ` Jeff King
2012-12-17 19:34                 ` Junio C Hamano
2012-12-17 19:49                   ` Jeff King
2012-12-17 20:03                     ` Junio C Hamano
2012-12-17 22:55                       ` Jeff King
2012-12-17 22:55                         ` [PATCH 1/2] t6006: clean up whitespace Junio C Hamano
2012-12-17 22:59                           ` Jeff King
2012-12-17 22:56                         ` Jeff King
2012-12-17 22:56                         ` [PATCH 2/2] log --format: teach %C(auto,black) to respect color config Jeff King
2012-12-17 12:40             ` [PATCH] log --format: teach %C(auto,black) to paint it black only on terminals Jeff King

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=20121213131329.GA5042@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=michal.srb11@imperial.ac.uk \
    /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).