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

Re: [PATCH] pretty: fix lost and leaked colors at line breaks

From
Andy Koppe <andy.koppe@gmail.com>
Date
Nov 17, 2026, 00:12 UTC
Message-ID
<CAHWeT-Z=pKMtGN7GU-UP_yrygTsihn-cwYoLPzjo9=3J_SjJ8Q@mail.gmail.com>
In-Reply-To
<xmqq4idgn3py.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 6 quoted lines
> And custom format writers have no way to control what happens at the
> (artificial) line boundary that wrapping at 72 columns %w(72)
> introduces, %b may include many lines but there is nothing for them
> to say "at the end of each and every line, do this".  And that is
> why you decided that runtime detection is the only way to do this to
> help custom formats?
Yes, exactly. I've tried to make that clearer in the commit message of v2.
> > The same can happen to
> > lines picked out by grepping colored output.
>
> I am not sure if that is a problem.
Fair enough. It's a minor point, so I've dropped it.
> > Secondly, colors that are still active at the end of a line can leak
> > into what follows.
>
> That somehow feels contradictory with the previous point, though.

You're right, I didn't put that well. The graph doesn't reset colors at the start of a line, but after each of its colored edges. So a color carried across a line break is lost once an edge has been drawn, but it leaks into anything drawn before that, notably the uncolored '*' commit marker. Attributes such as bold even leak into the edges themselves, as their colors only replace the foreground color. v2 rewords this.

Thanks, Andy

Previous: Junio C HamanoNext: Andy Koppe
Message 3 of 5 in “pretty: fix lost and leaked colors at line breaks”
  1. pretty: fix lost and leaked colors at line breaksAndy Koppe, Nov 15, 2026
  2. Junio C HamanoNov 16, 2026
  3. Andy KoppeNov 17, 2026
  4. pretty: fix lost and leaked colors at line breaksAndy Koppe, Nov 17, 2026
  5. pretty: fix lost and leaked colors at line breaksAndy Koppe, Nov 17, 2026

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.