summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-09-26 23:09:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-26 23:09:17 (GMT)
commite447d3182cf77f45402b6fc8a357a2ab466c49dd (patch)
tree9b5417e988a2a3bb423177d47c496d6c804bd00d /builtin
parent2a1f3fe6e3c3e21b97dc4fa488bee859289e32fd (diff)
parent68e83a5b8277adfc6f8a307bc2454bc6723717f4 (diff)
downloadgit-e447d3182cf77f45402b6fc8a357a2ab466c49dd.zip
git-e447d3182cf77f45402b6fc8a357a2ab466c49dd.tar.gz
git-e447d3182cf77f45402b6fc8a357a2ab466c49dd.tar.bz2
Merge branch 'jt/format-patch-rfc'
In some projects, it is common to use "[RFC PATCH]" as the subject prefix for a patch meant for discussion rather than application. A new option "--rfc" was a short-hand for "--subject-prefix=RFC PATCH" to help the participants of such projects. * jt/format-patch-rfc: format-patch: add "--rfc" for the common case of [RFC PATCH]
Diffstat (limited to 'builtin')
-rw-r--r--builtin/log.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/builtin/log.c b/builtin/log.c
index b8cdf2b..55d20cc 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -1111,6 +1111,11 @@ static int subject_prefix_callback(const struct option *opt, const char *arg,
return 0;
}
+static int rfc_callback(const struct option *opt, const char *arg, int unset)
+{
+ return subject_prefix_callback(opt, "RFC PATCH", unset);
+}
+
static int numbered_cmdline_opt = 0;
static int numbered_callback(const struct option *opt, const char *arg,
@@ -1418,6 +1423,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
N_("start numbering patches at <n> instead of 1")),
OPT_INTEGER('v', "reroll-count", &reroll_count,
N_("mark the series as Nth re-roll")),
+ { OPTION_CALLBACK, 0, "rfc", &rev, NULL,
+ N_("Use [RFC PATCH] instead of [PATCH]"),
+ PARSE_OPT_NOARG | PARSE_OPT_NONEG, rfc_callback },
{ OPTION_CALLBACK, 0, "subject-prefix", &rev, N_("prefix"),
N_("Use [<prefix>] instead of [PATCH]"),
PARSE_OPT_NONEG, subject_prefix_callback },
@@ -1556,7 +1564,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
if (numbered && keep_subject)
die (_("-n and -k are mutually exclusive."));
if (keep_subject && subject_prefix)
- die (_("--subject-prefix and -k are mutually exclusive."));
+ die (_("--subject-prefix/--rfc and -k are mutually exclusive."));
rev.preserve_subject = keep_subject;
argc = setup_revisions(argc, argv, &rev, &s_r_opt);