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

BUG: %+ format placeholder and colors

From
RBRaphael Bauer <raphael@pdev.de>
Date
Mar 22, 2022, 23:42 UTC
Message-ID
<600744a4-8d5a-0ef3-6e75-e3637e7070aa@pdev.de>
In-Reply-To
<6f0d1c12-4cf8-bbdd-96d4-eae99317e2e4@pdev.de>
Hello,

I am not familiar with using mailing list for bug tracking. I already reported this bug, but got no answer, so I wanted to mention it again.

* What did you do before the bug happened? (Steps to reproduce your issue)
git log --pretty=format:'%h%Cred%+d test' --graph

This also happens with a PAGER=cat environment, just to preclude this is related to the pager.

* What did you expect to happen? (Expected behavior)
A graph listing of commit hashes and, if ref names for this commit 
exist, a second line.
This line should be colored in red and contain the ref names as well as 
the string 'test'.
In the case of no refs, the string 'test' should appear in line with the 
commit hash, also in red.
* What happened instead? (Actual behavior)
In case of ref names / a second line, the color is missing completely.
The colors work correctly for the single line case (when no ref names 
are available).
* What's different between what you expected and what actually happened?
The %+d placeholder inserts newlines if the string is non-empty, but in 
doing so, resets any coloring information.
This is demonstrated by the string 'test' which should always show in 
red, but does so only if %+d is not expanded.
This makes it currently impossible to color anything with the %+ 
placeholder.
If this is already tracked, I apologize.
Previous: Raphael BauerNext: Ævar Arnfjörð Bjarmason
Message 4 of 11 in “Pretty format color bug”
  1. Raphael BauerFeb 21, 2022
  2. Ævar Arnfjörð BjarmasonFeb 21, 2022
  3. Raphael BauerFeb 22, 2022
  4. BUG: %+ format placeholder and colorsRaphael Bauer, Mar 22, 2022
  5. Ævar Arnfjörð BjarmasonMar 23, 2022
  6. RaphaelMar 23, 2022
  7. pretty format: fix colors on %+ placeholder newlineRaphael Bauer, Apr 5, 2022
  8. Junio C HamanoApr 6, 2022
  9. RaphaelApr 8, 2022
  10. Ævar Arnfjörð BjarmasonApr 8, 2022
  11. Junio C HamanoApr 8, 2022

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.