aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorMirko Faina <mroik@delayed.space>2026-03-23 17:57:34 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-23 13:06:59 -0700
commitd022dc77ab81fcc005b9965e91f524d4a43e74b5 (patch)
tree1b0676132010c62780cc77ea71a5fe2dab7c1359 /builtin
parent617db87921e835f02ac132e86d0f7edc0d72915e (diff)
downloadgit-d022dc77ab81fcc005b9965e91f524d4a43e74b5.tar.xz
format-patch: add preset for --commit-list-format
"git format-patch --commit-list-format" enables the user to make their own format for the commit list in the cover letter. It would be nice to have a ready to use format to replace shortlog. Teach make_cover_letter() the "modern" format preset. This new format is the same as: "log:[%(count)/%(total)] %s". Signed-off-by: Mirko Faina <mroik@delayed.space> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/log.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/builtin/log.c b/builtin/log.c
index d1765ce4ad..c6cf04350a 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1445,6 +1445,9 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file,
generate_commit_list_cover(rev->diffopt.file, format, list, nr);
else if (!strcmp(format, "shortlog"))
generate_shortlog_cover_letter(&log, rev, list, nr);
+ else if (!strcmp(format, "modern"))
+ generate_commit_list_cover(rev->diffopt.file, "[%(count)/%(total)] %s",
+ list, nr);
else
die(_("'%s' is not a valid format string"), format);