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]maint
commit
e447d3182c
|
@ -19,7 +19,8 @@ SYNOPSIS
|
||||||
[--start-number <n>] [--numbered-files]
|
[--start-number <n>] [--numbered-files]
|
||||||
[--in-reply-to=Message-Id] [--suffix=.<sfx>]
|
[--in-reply-to=Message-Id] [--suffix=.<sfx>]
|
||||||
[--ignore-if-in-upstream]
|
[--ignore-if-in-upstream]
|
||||||
[--subject-prefix=Subject-Prefix] [(--reroll-count|-v) <n>]
|
[--rfc] [--subject-prefix=Subject-Prefix]
|
||||||
|
[(--reroll-count|-v) <n>]
|
||||||
[--to=<email>] [--cc=<email>]
|
[--to=<email>] [--cc=<email>]
|
||||||
[--[no-]cover-letter] [--quiet] [--notes[=<ref>]]
|
[--[no-]cover-letter] [--quiet] [--notes[=<ref>]]
|
||||||
[<common diff options>]
|
[<common diff options>]
|
||||||
|
@ -172,6 +173,11 @@ will want to ensure that threading is disabled for `git send-email`.
|
||||||
allows for useful naming of a patch series, and can be
|
allows for useful naming of a patch series, and can be
|
||||||
combined with the `--numbered` option.
|
combined with the `--numbered` option.
|
||||||
|
|
||||||
|
--rfc::
|
||||||
|
Alias for `--subject-prefix="RFC PATCH"`. RFC means "Request For
|
||||||
|
Comments"; use this when sending an experimental patch for
|
||||||
|
discussion rather than application.
|
||||||
|
|
||||||
-v <n>::
|
-v <n>::
|
||||||
--reroll-count=<n>::
|
--reroll-count=<n>::
|
||||||
Mark the series as the <n>-th iteration of the topic. The
|
Mark the series as the <n>-th iteration of the topic. The
|
||||||
|
|
|
@ -1111,6 +1111,11 @@ static int subject_prefix_callback(const struct option *opt, const char *arg,
|
||||||
return 0;
|
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_cmdline_opt = 0;
|
||||||
|
|
||||||
static int numbered_callback(const struct option *opt, const char *arg,
|
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")),
|
N_("start numbering patches at <n> instead of 1")),
|
||||||
OPT_INTEGER('v', "reroll-count", &reroll_count,
|
OPT_INTEGER('v', "reroll-count", &reroll_count,
|
||||||
N_("mark the series as Nth re-roll")),
|
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"),
|
{ OPTION_CALLBACK, 0, "subject-prefix", &rev, N_("prefix"),
|
||||||
N_("Use [<prefix>] instead of [PATCH]"),
|
N_("Use [<prefix>] instead of [PATCH]"),
|
||||||
PARSE_OPT_NONEG, subject_prefix_callback },
|
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)
|
if (numbered && keep_subject)
|
||||||
die (_("-n and -k are mutually exclusive."));
|
die (_("-n and -k are mutually exclusive."));
|
||||||
if (keep_subject && subject_prefix)
|
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;
|
rev.preserve_subject = keep_subject;
|
||||||
|
|
||||||
argc = setup_revisions(argc, argv, &rev, &s_r_opt);
|
argc = setup_revisions(argc, argv, &rev, &s_r_opt);
|
||||||
|
|
|
@ -1086,6 +1086,15 @@ test_expect_success 'empty subject prefix does not have extra space' '
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success '--rfc' '
|
||||||
|
cat >expect <<-\EOF &&
|
||||||
|
Subject: [RFC PATCH 1/1] header with . in it
|
||||||
|
EOF
|
||||||
|
git format-patch -n -1 --stdout --rfc >patch &&
|
||||||
|
grep ^Subject: patch >actual &&
|
||||||
|
test_cmp expect actual
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success '--from=ident notices bogus ident' '
|
test_expect_success '--from=ident notices bogus ident' '
|
||||||
test_must_fail git format-patch -1 --stdout --from=foo >patch
|
test_must_fail git format-patch -1 --stdout --from=foo >patch
|
||||||
'
|
'
|
||||||
|
|
Loading…
Reference in New Issue