From 6a47bc216bb6393183bdd8084555c6ddc5015fb1 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Sat, 29 Oct 2016 14:16:45 -0700 Subject: [PATCH] format: Add --rfc option to use [RFC PATCH] as subject prefix --- git-series.1 | 4 ++++ src/main.rs | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/git-series.1 b/git-series.1 index c3e8c50539fefb61b31ae209a952bd88c482750f..c521caf3e7657b75bf5ae6b65b75f2278d1a5990 100644 --- a/git-series.1 +++ b/git-series.1 @@ -113,6 +113,7 @@ To start working on the branch again, use \fBgit series checkout\fR. \fBgit series format\fR [\fB--in-reply-to=\fR\fIMessage-Id\fR] \ [\fB--no-from\fR] \ [\fB-v\fR \fIN\fR | \fB--reroll-count=\fR\fIN\fR] \ +[\fB--rfc\fR] \ [\fB--stdout\fR] \ [\fB--subject-prefix=\fR\fISubject-Prefix\fR] Prepare the patch series to send via email. @@ -146,6 +147,9 @@ Use this when producing patch files for purposes other than email. Mark the patch series as PATCH v\fIN\fR. The patch filenames and mail subjects will include the version number. .TP +.B --rfc +Use [RFC PATCH] instead of the standard [PATCH] prefix. +.TP .B --stdout Write the entire patch series to stdout rather than to separate patch files. .TP diff --git a/src/main.rs b/src/main.rs index 001241caa9e0c3fefff618a122463f5952914f6d..7d20d0e9f5bc929e13b227ae5aca750f807788f4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1199,7 +1199,11 @@ fn format(out: &mut Output, repo: &Repository, m: &ArgMatches) -> Result<()> { }); let version = m.value_of("reroll-count"); - let subject_prefix = m.value_of("subject-prefix").unwrap_or("PATCH"); + let subject_prefix = if m.is_present("rfc") { + "RFC PATCH" + } else { + m.value_of("subject-prefix").unwrap_or("PATCH") + }; let subject_patch = version.map_or( subject_prefix.to_string(), |n| format!("{}{}v{}", subject_prefix, ensure_space(&subject_prefix), n)); @@ -1696,6 +1700,7 @@ fn main() { .arg_from_usage("--in-reply-to [Message-Id] 'Make the first mail a reply to the specified Message-Id'") .arg_from_usage("--no-from 'Don't include in-body \"From:\" headers when formatting patches authored by others'") .arg_from_usage("-v, --reroll-count=[N] 'Mark the patch series as PATCH vN'") + .arg(Arg::from_usage("--rfc 'Use [RFC PATCH] instead of the standard [PATCH] prefix'").conflicts_with("subject-prefix")) .arg_from_usage("--stdout 'Write patches to stdout rather than files'") .arg_from_usage("--subject-prefix [Subject-Prefix] 'Use [Subject-Prefix] instead of the standard [PATCH] prefix'"), SubCommand::with_name("log")