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

Re: [PATCH] format_commit_message: honor `color=auto` for `%C(auto)`

From
Jeff King <peff@peff.net>
Date
May 31, 2016, 22:18 UTC
Message-ID
<20160531221805.GB3824@sigill.intra.peff.net>
In-Reply-To
<CACsJy8BF6woZy8WUsJzVFqaMDCOMEYK-3xFNNeOQ6B+OMyqJLw@mail.gmail.com>
On Tue, May 31, 2016 at 07:23:32PM +0700, Duy Nguyen wrote:
> I think the (old) "auto" here means "automatically select the
> color" and what you do would be equivalent to %(auto,auto) where the
> first (and new) "auto" is about on/off switch, and the second is about
> selecting the actual color.

Ah, right. The current behavior does make more sense if you realize we are talking about two different meaning of "auto" here.

Show 11 quoted lines
> > I think it's worth mentioning this explicitly in the commit message. We
> > could also add "%C(on)", I guess, but it's unclear to me whether anybody
> > would want it (they would probably just use "--color" in that case,
> > unless they really want unconditional coloring for just _some_
> > elements).
> 
> If I could redo, I would go with %C(default) instead of %C(auto) then
> we could have %C(auto,default). Perhaps we can make %C(auto) an
> equivalent of %C(auto,default) now (i.e. exactly what this patch does)
> and at some point in future add %C(default) which is what %C(auto) is
> now if people really need to force it on?

That makes a lot of sense to me. It does change the current meaning of "%C(auto)", but the current state is sufficiently confusing that I think we can call the existing behavior a bug. I'm ambivalent on either implementing %C(default) now, or waiting until somebody actually wants it.

Thanks for clarifying the history.
-Peff
Previous: Duy Nguyen
Message 5 of 5 in “format_commit_message: honor `color=auto` for `%C(auto)`”
  1. format_commit_message: honor `color=auto` for `%C(auto)`Edward Thomson, May 25, 2016
  2. Jeff KingMay 25, 2016
  3. Edward ThomsonMay 27, 2016
  4. Duy NguyenMay 31, 2016
  5. Jeff KingMay 31, 2016

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.