]> Kevux Git Server - rit/commit
format-patch: add ability to use alt cover format
authorMirko Faina <mroik@delayed.space>
Fri, 6 Mar 2026 23:34:42 +0000 (00:34 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 7 Mar 2026 01:16:44 +0000 (17:16 -0800)
commit6005932d95ff05541f9dbe8c49a45b7abaf7432e
tree678a6136401f1ec13977e007ee968c5e37c9b10f
parent2af59cbcf4375f4d7c61954a19244d130de0a0db
format-patch: add ability to use alt cover format

Often when sending patch series there's a need to clarify to the
reviewer what's the purpose of said series, since it might be difficult
to understand it from reading the commits messages one by one.

"git format-patch" provides the useful "--cover-letter" flag to declare
if we want it to generate a template for us to use. By default it will
generate a "git shortlog" of the changes, which developers find less
useful than they'd like, mainly because the shortlog groups commits by
author, and gives no obvious chronological order.

Give format-patch the ability to specify an alternative format spec
through the "--cover-letter-format" option. This option either takes
"shortlog", which is the current format, or a format spec prefixed with
"log:".

Example:
    git format-patch --cover-letter \
        --cover-letter-format="log:[%(count)/%(total)] %s (%an)" HEAD~3

    [1/3] this is a commit summary (Mirko Faina)
    [2/3] this is another commit summary (Mirko Faina)
    ...

Signed-off-by: Mirko Faina <mroik@delayed.space>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/log.c
t/t4014-format-patch.sh
t/t9902-completion.sh