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

MINOR: log-format "%C" & "%+" log

From
Hari Lubovac <hlubovac@gmail.com>
Date
Aug 22, 2018, 16:46 UTC
Message-ID
<CAFLu24kbCJu74tgfRDR=xPZ3pkbau9R6jmqPbFKR=ZnWOvbCvQ@mail.gmail.com>
Hi -

I don't know where else to report this. It relates to the "log" command with "--pretty:format" argument.

It appears to me that "%C" format argument combined with "%+" or "%-" results in no color applied.

For example, I'd expect the last part of the output line ("%+D") to be colored red (it does when the "+" is removed):

git log --pretty="format:%C(Yellow)%t %C(reset)%ad %C(Cyan)%<(6,trunc)%an %C(reset)%s %C(Red)%+D" --date="format:%m/%d"

This info is taken from https://git-scm.com/docs/pretty-formats: "If you add a + (plus sign) after '%' of a placeholder..."

Thanks, Hari

Next: Jeff King
Message 1 of 2 in “MINOR: log-format "%C" & "%+" log”
  1. Hari LubovacAug 22, 2018
  2. Jeff KingAug 22, 2018

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.