aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorMirko Faina <mroik@delayed.space>2026-03-23 17:57:30 +0100
committerJunio C Hamano <gitster@pobox.com>2026-03-23 13:06:58 -0700
commit67ea2ad7d1b006194762cbfcc0b7801ffe652ca4 (patch)
treeba32e5ceaf94c19646bbc9382cdddf5c24aa5171 /builtin
parent3482b4278793f3adb1fa811dd30c637563ca9cec (diff)
downloadgit-67ea2ad7d1b006194762cbfcc0b7801ffe652ca4.tar.xz
format-patch: rename --cover-letter-format option
To align the name of the configuration variable and the name of the command line option, either one should change name. By changing the name of the option we get the added benefit of having --cover-<TAB> expand to --cover-letter without ambiguity. If the user gives the --cover-letter-format option it would be reasonable to expect that the user wants to generate the cover letter despite not giving --cover-letter. Rename --cover-letter-format to --commit-list-format and make it imply --cover-letter unless --no-cover-letter is given. 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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/log.c b/builtin/log.c
index 997bdd608e..a7f129d583 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -2014,7 +2014,7 @@ int cmd_format_patch(int argc,
N_("print patches to standard out")),
OPT_BOOL(0, "cover-letter", &cover_letter,
N_("generate a cover letter")),
- OPT_STRING(0, "cover-letter-format", &cover_letter_fmt, N_("format-spec"),
+ OPT_STRING(0, "commit-list-format", &cover_letter_fmt, N_("format-spec"),
N_("format spec used for the commit list in the cover letter")),
OPT_BOOL(0, "numbered-files", &just_numbers,
N_("use simple number sequence for output file names")),
@@ -2358,6 +2358,8 @@ int cmd_format_patch(int argc,
cover_letter_fmt = cfg.fmt_cover_letter_commit_list;
if (!cover_letter_fmt)
cover_letter_fmt = "shortlog";
+ } else if (cover_letter == -1) {
+ cover_letter = 1;
}
if (cover_letter == -1) {