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.