[GSoC][RFC PATCH 2/6] builtin/log: die if -k and --suject-extra-prefix are used together

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 builtin/log.c | 2 ++
 1 file changed, 2 insertions(+)

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);
-- 
2.39.5 (Apple Git-154)





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux