From: Jeff King Date: Thu, 19 Feb 2026 11:43:07 GMT Subject: Re: [PATCH v2] format-patch: fix From header in cover letter Message-ID: <20260219114307.GC3529@coredump.intra.peff.net> In-Reply-To: On Tue, Feb 17, 2026 at 07:22:33AM -0800, Junio C Hamano wrote: > > I never > > use it (and I probably forgot it even existed, given that most people > > would use send-email's cover letter generation, and I do my own thing > > with mutt). > > I use it myself and I really hate the way it lists the patches. We > should have done "log --oneline --reverse" instead of "shortlog", as > it is hard to understand the reference the cover letter message > makes to individual patches like "the first two patches do X", etc. Agreed. I have long hated the shortlog version. According to the commit history of my personal scripts, I've been sending with: [1/3]: subject of the first patch [2/3]: the second patch [3/3]: and so on since at least 2009, and nobody has complained. ;) Sadly I don't think there is an easy way to do so with "log --format", as it can't just be a single output placeholder (you have to do the whole traversal to get the "/3" part, so the caller needs to know this and queue up the output). I do it locally by piping the format-patch output through something like: sed -ne 's/^Subject: //p' | sed -e 's/\[PATCH /[/' \ -e 's/]/]:/' \ -e 's/^/ /' Of course that does not handle rfc822 header continuations, which we started to do at some point for long subjects. So now the first part is some gnarly perl. :-/ Probably some combination of "git log --format=%s", "nl", "wc -l" would be less horrid. I stuck with format-patch because of its somewhat magical command-line parsing of revisions. E.g., saying "git format-patch @{upstream}" will give you the patches on the topic branch, rather than all history down to the roots. But anyway, if this were happening internally in format-patch's cover-letter code, it should be quite easy to do (we have the complete list of patches and their subjects there already). -Peff