Subject: Re: [PATCH v3 0/8] improve "git format-patch --commit-list-format"

From: Junio C Hamano <[email-masked]>
Date: Fri, 27 Mar 2026 09:04:44 -0700

Mirko Faina <[email-masked]> writes:

> On Thu, Mar 26, 2026 at 09:37:17AM -0700, Junio C Hamano wrote:
>> Yup, I tried "modern" and generally liked it very much.
>> 
>> The appearance of the list looked a bit odd that each element in a
>> list of things with heading was shown without any indentation before
>> the heading, though.  I'd probably use
>> 
>>     --commit-list-format=" %(count): %<(72,trunc)%s"
>> 
>> or something like that myself.
>> 
>> I seem to be getting spurious blank lines between the lines with the
>> above, when I lengthen and shorten 72 in the format string above,
>> though.  I haven't figured out what is broken, though.
>
> Could this be because of strbuf_add_wrapped_text()?

Ahh, I think that would explain it.  In general, I think it is a
mistake to use strbuf_addwrapped_text() for any end-user
configurable output.  After all, wouldn't %w(w,i1,i2) work in the
format string?

> In a previous review
> someone pointed out that there was no wrapping,

When the payload _can_ be specified to wrap (i.e., end-user
configurable output format), the wrapping should not be forced by
the mechanism.  A project that is not ours may want to keep a single
long line for their commit list entries.

I do not mind if the default "modern" were defined to include %w()
to force wrapping to those who follow the default, of course.  But
do not unconditionally wrap what the end-user formatted to their
liking.