aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorMirko Faina <mroik@delayed.space>2026-03-23 17:57:35 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-23 13:06:59 -0700
commit36c16a5b7fff7806b475b5fa07eca3a5179d7fa6 (patch)
tree098ab742e268c4bf60b2a572f247b65667cdecff /builtin
parentd022dc77ab81fcc005b9965e91f524d4a43e74b5 (diff)
downloadgit-36c16a5b7fff7806b475b5fa07eca3a5179d7fa6.tar.xz
format-patch: --commit-list-format without prefix
Having to prefix a custom format-string with "log:" when passed from the CLI can be annoying. It would be great if this prefix wasn't required. Teach make_cover_letter() to accept custom format-strings without the "log:" prefix if a placeholder is detected. Note that both here and in "git log --format" the check is done naively by just checking for the presence of a '%'. 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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/log.c b/builtin/log.c
index c6cf04350a..ad7b7215fe 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1448,6 +1448,8 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file,
else if (!strcmp(format, "modern"))
generate_commit_list_cover(rev->diffopt.file, "[%(count)/%(total)] %s",
list, nr);
+ else if (strchr(format, '%'))
+ generate_commit_list_cover(rev->diffopt.file, format, list, nr);
else
die(_("'%s' is not a valid format string"), format);