Message ID | 20250303220029.10716-3-lucasseikioshiro@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | Add --subject-extra-prefix flag to format-patch | expand |
On Mon, Mar 3, 2025 at 5:01 PM Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> wrote: > builtin/log: die if -k and --suject-extra-prefix are used together s/suject/subject/ > When calling format-patch, -k keeps the commit title as the patch subject > and can't be used with other options that depend on the existence of a > prefix. This way, -k shouldn't also be used with --subject-extra-prefix, > as it introduces an extra prefix. > > If -k and --subject-extra-prefix are used together, die. > > Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
diff --git a/builtin/log.c b/builtin/log.c index 95667c93ca..52dc0301cf 100644 --- a/builtin/log.c +++ b/builtin/log.c @@ -2256,6 +2256,8 @@ int cmd_format_patch(int argc, die(_("options '%s' and '%s' cannot be used together"), "-n", "-k"); if (cfg.keep_subject && cfg.subject_prefix) die(_("options '%s' and '%s' cannot be used together"), "--subject-prefix/--rfc", "-k"); + if (cfg.keep_subject && extra_prefix) + die(_("options '%s' and '%s' cannot be used together"), "--subject-extra-prefix", "-k"); rev.preserve_subject = cfg.keep_subject; argc = setup_revisions(argc, argv, &rev, &s_r_opt);
When calling format-patch, -k keeps the commit title as the patch subject and can't be used with other options that depend on the existence of a prefix. This way, -k shouldn't also be used with --subject-extra-prefix, as it introduces an extra prefix. If -k and --subject-extra-prefix are used together, die. Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> --- builtin/log.c | 2 ++ 1 file changed, 2 insertions(+)