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

Re: [PATCH] pretty: fix lost indent after newline in %w()

From
Andy Koppe <andy.koppe@gmail.com>
Date
Oct 15, 2026, 20:11 UTC
Message-ID
<CAHWeT-ZuZ8ScKpdiV94UjvGNJmsv8vwy41Hm8OSCSETciFRh8g@mail.gmail.com>
In-Reply-To
<20261014172333.2224123-1-andy.koppe@gmail.com>
Andy Koppe wrote:
Show 8 quoted lines
> After a hard line break, 'space' already points to the first character
> of the next line. If that character is whitespace, it was wrongly
> skipped, so the line lost one column of indentation. For example,
>
>   git log --format="%w(11) This is%n  the %s%n  commit."
>
> printed " the ..." and " commit." rather than "  the ..." and
> "  commit.".

Admittedly, that's a bit of a silly example and test, just to keep it small. My actual use case is "%w(72)%B", because I often have to deal with repos that don't stick to line length standards, which can make a visual mess with --graph or with wide terminal windows.

As a better example, lists of files and their changes like this ...
- foo.c
  Frobble.
- bar.c
  Bobble.
... lose a space of indentation, thus breaking alignment:
- foo.c
 Frobble.
- bar.c
 Bobble.
Previous: Andy KoppeNext: René Scharfe
Message 2 of 6 in “pretty: fix lost indent after newline in %w()”
  1. pretty: fix lost indent after newline in %w()Andy Koppe, Oct 14, 2026
  2. Andy KoppeOct 15, 2026
  3. René ScharfeOct 15, 2026
  4. Junio C HamanoOct 15, 2026
  5. Andy KoppeOct 17, 2026
  6. pretty: fix lost indent after newline in %w()Andy Koppe, Oct 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.