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

From: Mirko Faina <[email-masked]>
Date: Mon, 23 Mar 2026 17:57:27 +0100

Not much has changed, just applied the suggestions Kristoffer made.
Thank you again for the review

[1/8] pretty.c: better die message %(count) and %(total) (Mirko Faina)
[2/8] format-patch: refactor generate_commit_list_cover (Mirko Faina)
[3/8] format-patch: rename --cover-letter-format option (Mirko Faina)
[4/8] docs/pretty-formats: add %(count) and %(total) (Mirko Faina)
[5/8] format.commitListFormat: strip meaning from empty (Mirko Faina)
[6/8] format-patch: wrap generate_commit_list_cover() (Mirko Faina)
[7/8] format-patch: add preset for --commit-list-format (Mirko Faina)
[8/8] format-patch: --commit-list-format without prefix (Mirko Faina)

 Documentation/config/format.adoc    |  2 +-
 Documentation/git-format-patch.adoc | 19 ++++----
 Documentation/pretty-formats.adoc   |  4 ++
 builtin/log.c                       | 35 +++++++-------
 pretty.c                            |  4 +-
 t/t4014-format-patch.sh             | 72 +++++++++++++++++++----------
 t/t9902-completion.sh               |  1 -
 7 files changed, 84 insertions(+), 53 deletions(-)

Range-diff against v2:
1:  a0d26c5999 = 1:  a0d26c5999 pretty.c: better die message %(count) and %(total)
2:  883dd358b6 = 2:  883dd358b6 format-patch: refactor generate_commit_list_cover
3:  5d061d6398 = 3:  5d061d6398 format-patch: rename --cover-letter-format option
4:  7b1e5cbb24 ! 4:  ce7d1bd1fe docs/pretty-formats: add %(count) and %(total)
    @@ Metadata
      ## Commit message ##
         docs/pretty-formats: add %(count) and %(total)
     
    -    When --commit-list-format has been introduced to format-patch, two new
    -    placeholders have been added to the PRETTY FORMATS code without being
    +    When --commit-list-format was introduced to format-patch, two new
    +    placeholders were added to the PRETTY FORMATS code without being
         documented. Do so now.
     
         Signed-off-by: Mirko Faina <[email-masked]>
    @@ Documentation/pretty-formats.adoc: The placeholders are:
      +%D+:: ref names without the " (", ")" wrapping.
     ++%(count)+:: the number of a patch within a patch series. Used only in
     +	`--commit-list-format` in `format-patch`
    -++%(total)+:: the number of tatal patches in a patch series. Used only in
    +++%(total)+:: the total number of patches in a patch series. Used only in
     +	`--commit-list-format` in `format-patch`
      ++%(decorate++`[:<option>,...]`++)++::
      ref names with custom decorations. The `decorate` string may be followed by a
5:  3cb0a0a088 ! 5:  66d30249bb format.commitListFormat: strip meaning from empty
    @@ Commit message
     
         The configuration variable format.commitListFormat allows for an empty
         value. This is unusual and can create issues when interacting with this
    -    configuration variable through the cli interface.
    +    configuration variable through the CLI.
     
         Strip meaning to format.commitListFormat with an empty value.
     
6:  3f547451a2 = 6:  c722fc9d0f format-patch: wrap generate_commit_list_cover()
7:  fdcb68e650 = 7:  bdd8f1fb57 format-patch: add preset for --commit-list-format
8:  ef0d3ed876 = 8:  d125458e33 format-patch: --commit-list-format without prefix
-- 
2.53.0.1118.gaef5881109