{"thread":{"id":"44116","subject":"[PATCH v3] format-patch: Add --rfc for the common case of [RFC PATCH]","startedAt":"2016-09-20T04:23:37Z","lastAt":"2016-09-21T15:57:55Z","messageCount":3,"participants":["Josh Triplett","Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":3,"patchTotal":null},"messages":[{"id":"302211","messageId":"501a6bfb2a70f44f080b2f119e4503ccbf88f639.1474330487.git-series.josh@joshtriplett.org","threadId":"44116","inReplyTo":null,"subject":"[PATCH v3] format-patch: Add --rfc for the common case of [RFC PATCH]","fromName":"Josh Triplett","fromEmail":"josh@joshtriplett.org","sentAt":"2016-09-20T04:23:25Z","receivedAt":"2016-09-20T04:23:37Z","isPatch":true,"sender":{"key":"josh@joshtriplett.org","avatar":"https://avatars.githubusercontent.com/u/162737?v=4"},"body":"This provides a shorter and more convenient alias for\n--subject-prefix='RFC PATCH'.\n\nIncludes documentation in the format-patch manpage, and a new test\ncovering --rfc.\n\nSigned-off-by: Josh Triplett <josh@joshtriplett.org>\n---\nv3:\n- Fix an error message referring to --subject-prefix\n- Expand the acronym \"RFC\"\nv2:\n- Add documentation to the format-patch manpage\n- Call subject_prefix_callback rather than reimplementing it\n- Update test to move expectations inside\n\n Documentation/git-format-patch.txt |  8 +++++++-\n builtin/log.c                      | 10 +++++++++-\n t/t4014-format-patch.sh            |  9 +++++++++\n 3 files changed, 25 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt\nindex 9624c84..9b200b3 100644\n--- a/Documentation/git-format-patch.txt\n+++ b/Documentation/git-format-patch.txt\n@@ -19,7 +19,8 @@ SYNOPSIS\n \t\t   [--start-number <n>] [--numbered-files]\n \t\t   [--in-reply-to=Message-Id] [--suffix=.<sfx>]\n \t\t   [--ignore-if-in-upstream]\n-\t\t   [--subject-prefix=Subject-Prefix] [(--reroll-count|-v) <n>]\n+\t\t   [--rfc] [--subject-prefix=Subject-Prefix]\n+\t\t   [(--reroll-count|-v) <n>]\n \t\t   [--to=<email>] [--cc=<email>]\n \t\t   [--[no-]cover-letter] [--quiet] [--notes[=<ref>]]\n \t\t   [<common diff options>]\n@@ -172,6 +173,11 @@ will want to ensure that threading is disabled for `git send-email`.\n \tallows for useful naming of a patch series, and can be\n \tcombined with the `--numbered` option.\n \n+--rfc::\n+\tAlias for `--subject-prefix=\"RFC PATCH\"`. RFC means \"Request For\n+\tComments\"; use this when sending an experimental patch for\n+\tdiscussion rather than application.\n+\n -v <n>::\n --reroll-count=<n>::\n \tMark the series as the <n>-th iteration of the topic. The\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 92dc34d..c657900 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -1112,6 +1112,11 @@ static int subject_prefix_callback(const struct option *opt, const char *arg,\n \treturn 0;\n }\n \n+static int rfc_callback(const struct option *opt, const char *arg, int unset)\n+{\n+\treturn subject_prefix_callback(opt, \"RFC PATCH\", unset);\n+}\n+\n static int numbered_cmdline_opt = 0;\n \n static int numbered_callback(const struct option *opt, const char *arg,\n@@ -1419,6 +1424,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \t\t\t    N_(\"start numbering patches at <n> instead of 1\")),\n \t\tOPT_INTEGER('v', \"reroll-count\", &reroll_count,\n \t\t\t    N_(\"mark the series as Nth re-roll\")),\n+\t\t{ OPTION_CALLBACK, 0, \"rfc\", &rev, NULL,\n+\t\t\t    N_(\"Use [RFC PATCH] instead of [PATCH]\"),\n+\t\t\t    PARSE_OPT_NOARG | PARSE_OPT_NONEG, rfc_callback },\n \t\t{ OPTION_CALLBACK, 0, \"subject-prefix\", &rev, N_(\"prefix\"),\n \t\t\t    N_(\"Use [<prefix>] instead of [PATCH]\"),\n \t\t\t    PARSE_OPT_NONEG, subject_prefix_callback },\n@@ -1557,7 +1565,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \tif (numbered && keep_subject)\n \t\tdie (_(\"-n and -k are mutually exclusive.\"));\n \tif (keep_subject && subject_prefix)\n-\t\tdie (_(\"--subject-prefix and -k are mutually exclusive.\"));\n+\t\tdie (_(\"--subject-prefix/--rfc and -k are mutually exclusive.\"));\n \trev.preserve_subject = keep_subject;\n \n \targc = setup_revisions(argc, argv, &rev, &s_r_opt);\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex b0579dd..ed4d3c2 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -1073,6 +1073,15 @@ test_expect_success 'empty subject prefix does not have extra space' '\n \ttest_cmp expect actual\n '\n \n+test_expect_success '--rfc' '\n+\tcat >expect <<-\\EOF &&\n+\tSubject: [RFC PATCH 1/1] header with . in it\n+\tEOF\n+\tgit format-patch -n -1 --stdout --rfc >patch &&\n+\tgrep ^Subject: patch >actual &&\n+\ttest_cmp expect actual\n+'\n+\n test_expect_success '--from=ident notices bogus ident' '\n \ttest_must_fail git format-patch -1 --stdout --from=foo >patch\n '\n\nbase-commit: 6ebdac1bab966b720d776aa43ca188fe378b1f4b\n-- \ngit-series 0.8.10\n"},{"id":"302213","messageId":"20160920042946.735auuwzsy2lv3yt@sigill.intra.peff.net","threadId":"44116","inReplyTo":"501a6bfb2a70f44f080b2f119e4503ccbf88f639.1474330487.git-series.josh@joshtriplett.org","subject":"Re: [PATCH v3] format-patch: Add --rfc for the common case of [RFC PATCH]","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-09-20T04:29:47Z","receivedAt":"2016-09-20T04:29:53Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Sep 19, 2016 at 09:23:25PM -0700, Josh Triplett wrote:\n\n> This provides a shorter and more convenient alias for\n> --subject-prefix='RFC PATCH'.\n> \n> Includes documentation in the format-patch manpage, and a new test\n> covering --rfc.\n> \n> Signed-off-by: Josh Triplett <josh@joshtriplett.org>\n> ---\n> v3:\n> - Fix an error message referring to --subject-prefix\n> - Expand the acronym \"RFC\"\n\nThis looks fine to me. Thanks.\n\n-Peff\n"},{"id":"302280","messageId":"xmqqy42lb5z9.fsf@gitster.mtv.corp.google.com","threadId":"44116","inReplyTo":"501a6bfb2a70f44f080b2f119e4503ccbf88f639.1474330487.git-series.josh@joshtriplett.org","subject":"Re: [PATCH v3] format-patch: Add --rfc for the common case of [RFC PATCH]","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-09-21T15:57:46Z","receivedAt":"2016-09-21T15:57:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Josh Triplett <josh@joshtriplett.org> writes:\n\n> This provides a shorter and more convenient alias for\n> --subject-prefix='RFC PATCH'.\n\nShorter and more convenient is quite subjective but more important\nas a justification is that we believe [RFC PATCH] is used fairly\ncommonly (at least in certain circles).\n\n> Includes documentation in the format-patch manpage, and a new test\n> covering --rfc.\n\nWe can see that from diffstat ;-)\n\nI'd retitle this like so:\n\n    format-patch: add \"--rfc\" for the common case of [RFC PATCH]\n\n    Add an alias for --subject-prefix='RFC PATCH', which is used\n    commonly in some development communities to deserve such a\n    short-hand.\n\n    Signed-off-by: Josh Triplett <josh@joshtriplett.org>\n    Reviewed-by: Jeff King <peff@peff.net>\n    Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\n> diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt\n> index 9624c84..9b200b3 100644\n> --- a/Documentation/git-format-patch.txt\n> +++ b/Documentation/git-format-patch.txt\n> @@ -19,7 +19,8 @@ SYNOPSIS\n>  \t\t   [--start-number <n>] [--numbered-files]\n>  \t\t   [--in-reply-to=Message-Id] [--suffix=.<sfx>]\n>  \t\t   [--ignore-if-in-upstream]\n> -\t\t   [--subject-prefix=Subject-Prefix] [(--reroll-count|-v) <n>]\n> +\t\t   [--rfc] [--subject-prefix=Subject-Prefix]\n> +\t\t   [(--reroll-count|-v) <n>]\n>  \t\t   [--to=<email>] [--cc=<email>]\n>  \t\t   [--[no-]cover-letter] [--quiet] [--notes[=<ref>]]\n>  \t\t   [<common diff options>]\n> @@ -172,6 +173,11 @@ will want to ensure that threading is disabled for `git send-email`.\n>  \tallows for useful naming of a patch series, and can be\n>  \tcombined with the `--numbered` option.\n>  \n> +--rfc::\n> +\tAlias for `--subject-prefix=\"RFC PATCH\"`. RFC means \"Request For\n> +\tComments\"; use this when sending an experimental patch for\n> +\tdiscussion rather than application.\n> +\n\nI do not think we want to be in the business of encouragign or\ndiscouraging the use of \"[RFC PATCH]\".  \n\n\t--rfc:: A short-hand for `--subject-prefix=\"RFC PATCH\"`.\n        \tRFC stands for \"request for comments\" and such a\n        \tprefix is used in some development communities when\n        \tsending a patch primarily to illustrate an idea to\n        \thelp discussion, rather than to be applied.\n\nperhaps?\n\nThe code and test both look good to me.\n\nThanks.\n"}]}