Subject: Re: [RFC PATCH] format-patch: better commit list for cover letter

From: Junio C Hamano <[email-masked]>
Date: Sat, 21 Feb 2026 09:33:00 -0800

Mirko Faina <[email-masked]> writes:

> On Fri, Feb 20, 2026 at 10:02:21PM -0800, Junio C Hamano wrote:
>>
>> Just off the top of my head...
>>
>> Perhaps with
>>
>>     [format]
>> 	commitListFormat ;# true
>>
>> we use
>>
>> 	[1/1] format-patch: better commit list for cover letter
>>
>> and with
>>
>>     [format]
>> 	commitListFormat="%s (%an)"
>>
>> we use
>>
>> 	[1/1] format-patch: better commit list for cover letter	(Mirko Faina)
>>
>> instead.  IOW, the value of the configuration variable is used as
>> the format argument "log --format=...", and appended to the fixed
>> [n/m] that gives the numbers.
>>
>> Without format.commitListFormat defined, or when it is defined to
>> false, we'd use the traditional "shortlog" format.
>>
>> Hmm?
>
> Yes, sounds good.
>
>> And the corresponding command line option can look like
>> 
>> 	--cover-letter=(shortlog | log:<log format spec>)
>> 
>> e.g.,
>> 
>> 	--cover-letter=log:"%s (%an)"
>> 
>> to override configured value per invocation basis.
>
> Not too sure about this one. The point was to have a useful default for
> the cover letter template. If users have to pass a format spec through
> the command line it kinda defeates the purpose.

When adding a configuration, never assume that the setting the user
chooses is good for that user 100% of the time.  You'd need a way
from the command line to override a configured value.

Not having a command line option does defeat the point of adding a
configuration, which can even be used for a setting that is good for
the user only 80% of the time.