git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] pretty.c: Make user defined format honor color option

From
Will Palmer <wmpalmer@gmail.com>
Date
Mar 17, 2011, 12:59 UTC
Message-ID
<1300366792.3269.24.camel@wpalmer.simply-domain>
In-Reply-To
<4D81F860.2070703@secunet.com>
On Thu, 2011-03-17 at 13:02 +0100, Thomas Egerer wrote:
Show 16 quoted lines
> On 03/17/2011 10:39 AM, Will Palmer schrobtete:
> > On Thu, 2011-03-17 at 09:33 +0100, Thomas Egerer wrote:
> >> This patch fixes that the pretty-formats tformat and format ignore
> >> git's color option.
> > 
> > It is my understanding that this is intentional, the logic being: If you
> > normally don't want color, but have specified it directly on the
> > command-line, you probably want color.
> I'm using the pretty format in the context of an alias. My global setting
> for colors is auto. I would expect git to not disregard this options. I
> usually use the alias to display a git log in a modified way, but I also
> do sometimes pipe it to grep. If there was a way to suppress output
> colorization (let's say by not using global options but the command line
> switch --color=never) that would work for me. But there is no wa and I
> find it inconvinient to have two different aliases doing the same thing
> one with color and one without while there would be a much simpler way.
...snip
> Thomas

Perhaps --color=auto, specified on the command-line, should behave differently to the various color options specified via config. That might make both sides happy, as one could always specify --color=auto to explicitly tell git to only color if it thinks it should.

Can anyone else refresh my memory regarding the use-case where hand-specified colors really should have an effect even with --color=never?

Previous: Thomas EgererNext: Jeff King
Message 4 of 6 in “pretty.c: Make user defined format honor color option”
  1. pretty.c: Make user defined format honor color optionThomas Egerer, Mar 17, 2011
  2. Will PalmerMar 17, 2011
  3. Thomas EgererMar 17, 2011
  4. Will PalmerMar 17, 2011
  5. Jeff KingMar 17, 2011
  6. Thomas EgererMar 17, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.