{"thread":{"id":"61336","subject":"[PATCH] format-patch: ensure that --rfc and -k are mutually exclusive","startedAt":"2024-04-19T01:05:36Z","lastAt":"2024-04-21T14:00:59Z","messageCount":8,"participants":["Dragan Simic","Drew DeVault","Kristoffer Haugsbakk","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"493178","messageId":"71d195c248879e7c46fac0e84c6b0a8aa90bd2c2.1713488563.git.dsimic@manjaro.org","threadId":"61336","inReplyTo":null,"subject":"[PATCH] format-patch: ensure that --rfc and -k are mutually exclusive","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-04-19T01:05:30Z","receivedAt":"2024-04-19T01:05:36Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"Fix a bug that allows the \"--rfc\" and \"-k\" options to be specified together\nwhen \"git format-patch\" is executed, which was introduced in the commit\ne0d7db7423a9 (\"format-patch: --rfc honors what --subject-prefix sets\").\n\nAdd a couple of additional tests to t4014, to cover additional cases of\nthe mutual exclusivity between different \"git format-patch\" options.\n\nSigned-off-by: Dragan Simic <dsimic@manjaro.org>\n---\n\nNotes:\n    This patch originates from my earlier patch series, [1] for which\n    it was concluded to not be acceptable in its entirety. [2]\n    \n    This version of the patch includes improvements based on the valuable\n    and appreciated feedback from the reviewers:\n      - Improved and simplified the patch subject and patch description, as\n        suggested by Eric Sunshine [3] and Kristoffer Haugsbakk [4]\n      - Removed a redundant comment from the bugfix, as suggested by Eric\n        Sunshine and Kristoffer Haugsbakk [5]\n      - Squashed the bugfix and the new tests into a single patch, for easier\n        reviewing, as suggested by Eric Sunshine [6]\n      - Improved the main new test, as suggested by Kristoffer Haugsbakk, [4]\n        and added validation of both stdout and stderr outputs\n      - Added a couple of more tests, to cover additional cases of the mutual\n        exclusivity of the available command-line options\n    \n    [1] https://lore.kernel.org/git/b7568429acad91ff2d9a1574111441a3@manjaro.org/T/#mfcbbcf38e23698d09f524cc3b49ed1d855b90018\n    [2] https://lore.kernel.org/git/b7568429acad91ff2d9a1574111441a3@manjaro.org/T/#m9441b5486ca9229d5bfff9c2a92bc80eef341baf\n    [3] https://lore.kernel.org/git/CAPig+cTEp799w2-VEACYThW0COyo0SJLRS_sr-PG=LX++Tompw@mail.gmail.com/T/#u\n    [4] https://lore.kernel.org/git/e4aa5235-c6ad-45c7-930e-de991cc375f2@app.fastmail.com/T/#u\n    [5] https://lore.kernel.org/git/CAPig+cSGZr4zE=Dp7Z58CN0kmkpXdc8SOopXmB9=ry4gwNkq=w@mail.gmail.com/T/#u\n    [6] https://lore.kernel.org/git/CAPig+cRBjosyadQHO03fcCz7YBc=T04ytHkpt9UU87tLaiSOgw@mail.gmail.com/T/#u\n\nRange-diff:\n1:  25b90d065744 < -:  ------------ format-patch docs: avoid use of parentheses to improve readability\n2:  c975f961779b ! 1:  71d195c24887 format-patch: fix a bug in option exclusivity and add a test to t4014\n    @@ Metadata\n     Author: Dragan Simic <dsimic@manjaro.org>\n     \n      ## Commit message ##\n    -    format-patch: fix a bug in option exclusivity and add a test to t4014\n    +    format-patch: ensure that --rfc and -k are mutually exclusive\n     \n    -    Fix a bug that allows --rfc and -k options to be specified together when\n    -    executing \"git format-patch\".  This bug was introduced back in the commit\n    -    e0d7db7423a9 (\"format-patch: --rfc honors what --subject-prefix sets\"),\n    -    about eight months ago, but it has remained undetected so far, presumably\n    -    because of no associated test coverage.\n    +    Fix a bug that allows the \"--rfc\" and \"-k\" options to be specified together\n    +    when \"git format-patch\" is executed, which was introduced in the commit\n    +    e0d7db7423a9 (\"format-patch: --rfc honors what --subject-prefix sets\").\n     \n    -    Add a new test to the t4014 that covers the mutual exclusivity of the --rfc\n    -    and -k command-line options for \"git format-patch\", for future coverage.\n    +    Add a couple of additional tests to t4014, to cover additional cases of\n    +    the mutual exclusivity between different \"git format-patch\" options.\n     \n         Signed-off-by: Dragan Simic <dsimic@manjaro.org>\n     \n    +\n    + ## Notes ##\n    +    This patch originates from my earlier patch series, [1] for which\n    +    it was concluded to not be acceptable in its entirety. [2]\n    +\n    +    This version of the patch includes improvements based on the valuable\n    +    and appreciated feedback from the reviewers:\n    +      - Improved and simplified the patch subject and patch description, as\n    +        suggested by Eric Sunshine [3] and Kristoffer Haugsbakk [4]\n    +      - Removed a redundant comment from the bugfix, as suggested by Eric\n    +        Sunshine and Kristoffer Haugsbakk [5]\n    +      - Squashed the bugfix and the new tests into a single patch, for easier\n    +        reviewing, as suggested by Eric Sunshine [6]\n    +      - Improved the main new test, as suggested by Kristoffer Haugsbakk, [4]\n    +        and added validation of both stdout and stderr outputs\n    +      - Added a couple of more tests, to cover additional cases of the mutual\n    +        exclusivity of the available command-line options\n    +\n    +    [1] https://lore.kernel.org/git/b7568429acad91ff2d9a1574111441a3@manjaro.org/T/#mfcbbcf38e23698d09f524cc3b49ed1d855b90018\n    +    [2] https://lore.kernel.org/git/b7568429acad91ff2d9a1574111441a3@manjaro.org/T/#m9441b5486ca9229d5bfff9c2a92bc80eef341baf\n    +    [3] https://lore.kernel.org/git/CAPig+cTEp799w2-VEACYThW0COyo0SJLRS_sr-PG=LX++Tompw@mail.gmail.com/T/#u\n    +    [4] https://lore.kernel.org/git/e4aa5235-c6ad-45c7-930e-de991cc375f2@app.fastmail.com/T/#u\n    +    [5] https://lore.kernel.org/git/CAPig+cSGZr4zE=Dp7Z58CN0kmkpXdc8SOopXmB9=ry4gwNkq=w@mail.gmail.com/T/#u\n    +    [6] https://lore.kernel.org/git/CAPig+cRBjosyadQHO03fcCz7YBc=T04ytHkpt9UU87tLaiSOgw@mail.gmail.com/T/#u\n    +\n      ## builtin/log.c ##\n     @@ builtin/log.c: int cmd_format_patch(int argc, const char **argv, const char *prefix)\n      \tif (cover_from_description_arg)\n      \t\tcover_from_description_mode = parse_cover_from_description(cover_from_description_arg);\n      \n     -\tif (rfc)\n    -+\t/* Also mark the subject prefix as modified, for later checks */\n     +\tif (rfc) {\n      \t\tstrbuf_insertstr(&sprefix, 0, \"RFC \");\n     +\t\tsubject_prefix = 1;\n     +\t}\n      \n      \tif (reroll_count) {\n      \t\tstrbuf_addf(&sprefix, \" v%s\", reroll_count);\n     \n      ## t/t4014-format-patch.sh ##\n     @@ t/t4014-format-patch.sh: test_expect_success '--rfc is argument order independent' '\n      \ttest_cmp expect actual\n      '\n      \n    ++test_expect_success '--subject-prefix=\"<non-empty>\" and -k cannot be used together' '\n    ++\techo \"fatal: options '\\''--subject-prefix/--rfc'\\'' and '\\''-k'\\'' cannot be used together\" >expect.err &&\n    ++\ttest_must_fail git format-patch -1 --stdout --subject-prefix=\"MYPREFIX\" -k >actual.out 2>actual.err &&\n    ++\ttest_must_be_empty actual.out &&\n    ++\ttest_cmp expect.err actual.err\n    ++'\n    ++\n    ++test_expect_success '--subject-prefix=\"\" and -k cannot be used together' '\n    ++\techo \"fatal: options '\\''--subject-prefix/--rfc'\\'' and '\\''-k'\\'' cannot be used together\" >expect.err &&\n    ++\ttest_must_fail git format-patch -1 --stdout --subject-prefix=\"\" -k >actual.out 2>actual.err &&\n    ++\ttest_must_be_empty actual.out &&\n    ++\ttest_cmp expect.err actual.err\n    ++'\n    ++\n     +test_expect_success '--rfc and -k cannot be used together' '\n    -+\ttest_must_fail git format-patch -1 --stdout --rfc -k >patch\n    ++\techo \"fatal: options '\\''--subject-prefix/--rfc'\\'' and '\\''-k'\\'' cannot be used together\" >expect.err &&\n    ++\ttest_must_fail git format-patch -1 --stdout --rfc -k >actual.out 2>actual.err &&\n    ++\ttest_must_be_empty actual.out &&\n    ++\ttest_cmp expect.err actual.err\n     +'\n     +\n      test_expect_success '--from=ident notices bogus ident' '\n3:  1d9c6ce3df71 < -:  ------------ format-patch: new --resend option for adding \"RESEND\" to patch subjects\n4:  42865d6c6694 < -:  ------------ t4014: add tests to cover --resend option and its exclusivity\n\n builtin/log.c           |  4 +++-\n t/t4014-format-patch.sh | 21 +++++++++++++++++++++\n 2 files changed, 24 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/log.c b/builtin/log.c\nindex c0a8bb95e983..8bab30fcc70d 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -2050,8 +2050,10 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)\n \tif (cover_from_description_arg)\n \t\tcover_from_description_mode = parse_cover_from_description(cover_from_description_arg);\n \n-\tif (rfc)\n+\tif (rfc) {\n \t\tstrbuf_insertstr(&sprefix, 0, \"RFC \");\n+\t\tsubject_prefix = 1;\n+\t}\n \n \tif (reroll_count) {\n \t\tstrbuf_addf(&sprefix, \" v%s\", reroll_count);\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex e37a1411ee24..90fe6d066cc0 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -1397,6 +1397,27 @@ test_expect_success '--rfc is argument order independent' '\n \ttest_cmp expect actual\n '\n \n+test_expect_success '--subject-prefix=\"<non-empty>\" and -k cannot be used together' '\n+\techo \"fatal: options '\\''--subject-prefix/--rfc'\\'' and '\\''-k'\\'' cannot be used together\" >expect.err &&\n+\ttest_must_fail git format-patch -1 --stdout --subject-prefix=\"MYPREFIX\" -k >actual.out 2>actual.err &&\n+\ttest_must_be_empty actual.out &&\n+\ttest_cmp expect.err actual.err\n+'\n+\n+test_expect_success '--subject-prefix=\"\" and -k cannot be used together' '\n+\techo \"fatal: options '\\''--subject-prefix/--rfc'\\'' and '\\''-k'\\'' cannot be used together\" >expect.err &&\n+\ttest_must_fail git format-patch -1 --stdout --subject-prefix=\"\" -k >actual.out 2>actual.err &&\n+\ttest_must_be_empty actual.out &&\n+\ttest_cmp expect.err actual.err\n+'\n+\n+test_expect_success '--rfc and -k cannot be used together' '\n+\techo \"fatal: options '\\''--subject-prefix/--rfc'\\'' and '\\''-k'\\'' cannot be used together\" >expect.err &&\n+\ttest_must_fail git format-patch -1 --stdout --rfc -k >actual.out 2>actual.err &&\n+\ttest_must_be_empty actual.out &&\n+\ttest_cmp expect.err actual.err\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"},{"id":"493180","messageId":"b4c6cbf5f3246ecd0cf27c7e87bf6dfc@manjaro.org","threadId":"61336","inReplyTo":"71d195c248879e7c46fac0e84c6b0a8aa90bd2c2.1713488563.git.dsimic@manjaro.org","subject":"Re: [PATCH] format-patch: ensure that --rfc and -k are mutually exclusive","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-04-19T02:58:20Z","receivedAt":"2024-04-19T02:58:23Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"+Cc: Drew DeVault <sir@cmpwn.com>\n\nOn 2024-04-19 03:05, Dragan Simic wrote:\n> Fix a bug that allows the \"--rfc\" and \"-k\" options to be specified \n> together\n> when \"git format-patch\" is executed, which was introduced in the commit\n> e0d7db7423a9 (\"format-patch: --rfc honors what --subject-prefix sets\").\n> \n> Add a couple of additional tests to t4014, to cover additional cases of\n> the mutual exclusivity between different \"git format-patch\" options.\n> \n> Signed-off-by: Dragan Simic <dsimic@manjaro.org>\n> ---\n> \n> Notes:\n>     This patch originates from my earlier patch series, [1] for which\n>     it was concluded to not be acceptable in its entirety. [2]\n> \n>     This version of the patch includes improvements based on the \n> valuable\n>     and appreciated feedback from the reviewers:\n>       - Improved and simplified the patch subject and patch \n> description, as\n>         suggested by Eric Sunshine [3] and Kristoffer Haugsbakk [4]\n>       - Removed a redundant comment from the bugfix, as suggested by \n> Eric\n>         Sunshine and Kristoffer Haugsbakk [5]\n>       - Squashed the bugfix and the new tests into a single patch, for \n> easier\n>         reviewing, as suggested by Eric Sunshine [6]\n>       - Improved the main new test, as suggested by Kristoffer \n> Haugsbakk, [4]\n>         and added validation of both stdout and stderr outputs\n>       - Added a couple of more tests, to cover additional cases of the \n> mutual\n>         exclusivity of the available command-line options\n> \n>     [1]\n> https://lore.kernel.org/git/b7568429acad91ff2d9a1574111441a3@manjaro.org/T/#mfcbbcf38e23698d09f524cc3b49ed1d855b90018\n>     [2]\n> https://lore.kernel.org/git/b7568429acad91ff2d9a1574111441a3@manjaro.org/T/#m9441b5486ca9229d5bfff9c2a92bc80eef341baf\n>     [3]\n> https://lore.kernel.org/git/CAPig+cTEp799w2-VEACYThW0COyo0SJLRS_sr-PG=LX++Tompw@mail.gmail.com/T/#u\n>     [4]\n> https://lore.kernel.org/git/e4aa5235-c6ad-45c7-930e-de991cc375f2@app.fastmail.com/T/#u\n>     [5]\n> https://lore.kernel.org/git/CAPig+cSGZr4zE=Dp7Z58CN0kmkpXdc8SOopXmB9=ry4gwNkq=w@mail.gmail.com/T/#u\n>     [6]\n> https://lore.kernel.org/git/CAPig+cRBjosyadQHO03fcCz7YBc=T04ytHkpt9UU87tLaiSOgw@mail.gmail.com/T/#u\n> \n> Range-diff:\n> 1:  25b90d065744 < -:  ------------ format-patch docs: avoid use of\n> parentheses to improve readability\n> 2:  c975f961779b ! 1:  71d195c24887 format-patch: fix a bug in option\n> exclusivity and add a test to t4014\n>     @@ Metadata\n>      Author: Dragan Simic <dsimic@manjaro.org>\n> \n>       ## Commit message ##\n>     -    format-patch: fix a bug in option exclusivity and add a test \n> to t4014\n>     +    format-patch: ensure that --rfc and -k are mutually exclusive\n> \n>     -    Fix a bug that allows --rfc and -k options to be specified\n> together when\n>     -    executing \"git format-patch\".  This bug was introduced back\n> in the commit\n>     -    e0d7db7423a9 (\"format-patch: --rfc honors what \n> --subject-prefix sets\"),\n>     -    about eight months ago, but it has remained undetected so\n> far, presumably\n>     -    because of no associated test coverage.\n>     +    Fix a bug that allows the \"--rfc\" and \"-k\" options to be\n> specified together\n>     +    when \"git format-patch\" is executed, which was introduced in \n> the commit\n>     +    e0d7db7423a9 (\"format-patch: --rfc honors what \n> --subject-prefix sets\").\n> \n>     -    Add a new test to the t4014 that covers the mutual\n> exclusivity of the --rfc\n>     -    and -k command-line options for \"git format-patch\", for\n> future coverage.\n>     +    Add a couple of additional tests to t4014, to cover additional \n> cases of\n>     +    the mutual exclusivity between different \"git format-patch\" \n> options.\n> \n>          Signed-off-by: Dragan Simic <dsimic@manjaro.org>\n> \n>     +\n>     + ## Notes ##\n>     +    This patch originates from my earlier patch series, [1] for \n> which\n>     +    it was concluded to not be acceptable in its entirety. [2]\n>     +\n>     +    This version of the patch includes improvements based on the \n> valuable\n>     +    and appreciated feedback from the reviewers:\n>     +      - Improved and simplified the patch subject and patch \n> description, as\n>     +        suggested by Eric Sunshine [3] and Kristoffer Haugsbakk \n> [4]\n>     +      - Removed a redundant comment from the bugfix, as suggested \n> by Eric\n>     +        Sunshine and Kristoffer Haugsbakk [5]\n>     +      - Squashed the bugfix and the new tests into a single\n> patch, for easier\n>     +        reviewing, as suggested by Eric Sunshine [6]\n>     +      - Improved the main new test, as suggested by Kristoffer\n> Haugsbakk, [4]\n>     +        and added validation of both stdout and stderr outputs\n>     +      - Added a couple of more tests, to cover additional cases\n> of the mutual\n>     +        exclusivity of the available command-line options\n>     +\n>     +    [1]\n> https://lore.kernel.org/git/b7568429acad91ff2d9a1574111441a3@manjaro.org/T/#mfcbbcf38e23698d09f524cc3b49ed1d855b90018\n>     +    [2]\n> https://lore.kernel.org/git/b7568429acad91ff2d9a1574111441a3@manjaro.org/T/#m9441b5486ca9229d5bfff9c2a92bc80eef341baf\n>     +    [3]\n> https://lore.kernel.org/git/CAPig+cTEp799w2-VEACYThW0COyo0SJLRS_sr-PG=LX++Tompw@mail.gmail.com/T/#u\n>     +    [4]\n> https://lore.kernel.org/git/e4aa5235-c6ad-45c7-930e-de991cc375f2@app.fastmail.com/T/#u\n>     +    [5]\n> https://lore.kernel.org/git/CAPig+cSGZr4zE=Dp7Z58CN0kmkpXdc8SOopXmB9=ry4gwNkq=w@mail.gmail.com/T/#u\n>     +    [6]\n> https://lore.kernel.org/git/CAPig+cRBjosyadQHO03fcCz7YBc=T04ytHkpt9UU87tLaiSOgw@mail.gmail.com/T/#u\n>     +\n>       ## builtin/log.c ##\n>      @@ builtin/log.c: int cmd_format_patch(int argc, const char\n> **argv, const char *prefix)\n>       \tif (cover_from_description_arg)\n>       \t\tcover_from_description_mode =\n> parse_cover_from_description(cover_from_description_arg);\n> \n>      -\tif (rfc)\n>     -+\t/* Also mark the subject prefix as modified, for later checks */\n>      +\tif (rfc) {\n>       \t\tstrbuf_insertstr(&sprefix, 0, \"RFC \");\n>      +\t\tsubject_prefix = 1;\n>      +\t}\n> \n>       \tif (reroll_count) {\n>       \t\tstrbuf_addf(&sprefix, \" v%s\", reroll_count);\n> \n>       ## t/t4014-format-patch.sh ##\n>      @@ t/t4014-format-patch.sh: test_expect_success '--rfc is\n> argument order independent' '\n>       \ttest_cmp expect actual\n>       '\n> \n>     ++test_expect_success '--subject-prefix=\"<non-empty>\" and -k\n> cannot be used together' '\n>     ++\techo \"fatal: options '\\''--subject-prefix/--rfc'\\'' and\n> '\\''-k'\\'' cannot be used together\" >expect.err &&\n>     ++\ttest_must_fail git format-patch -1 --stdout\n> --subject-prefix=\"MYPREFIX\" -k >actual.out 2>actual.err &&\n>     ++\ttest_must_be_empty actual.out &&\n>     ++\ttest_cmp expect.err actual.err\n>     ++'\n>     ++\n>     ++test_expect_success '--subject-prefix=\"\" and -k cannot be used \n> together' '\n>     ++\techo \"fatal: options '\\''--subject-prefix/--rfc'\\'' and\n> '\\''-k'\\'' cannot be used together\" >expect.err &&\n>     ++\ttest_must_fail git format-patch -1 --stdout --subject-prefix=\"\"\n> -k >actual.out 2>actual.err &&\n>     ++\ttest_must_be_empty actual.out &&\n>     ++\ttest_cmp expect.err actual.err\n>     ++'\n>     ++\n>      +test_expect_success '--rfc and -k cannot be used together' '\n>     -+\ttest_must_fail git format-patch -1 --stdout --rfc -k >patch\n>     ++\techo \"fatal: options '\\''--subject-prefix/--rfc'\\'' and\n> '\\''-k'\\'' cannot be used together\" >expect.err &&\n>     ++\ttest_must_fail git format-patch -1 --stdout --rfc -k\n> >actual.out 2>actual.err &&\n>     ++\ttest_must_be_empty actual.out &&\n>     ++\ttest_cmp expect.err actual.err\n>      +'\n>      +\n>       test_expect_success '--from=ident notices bogus ident' '\n> 3:  1d9c6ce3df71 < -:  ------------ format-patch: new --resend option\n> for adding \"RESEND\" to patch subjects\n> 4:  42865d6c6694 < -:  ------------ t4014: add tests to cover --resend\n> option and its exclusivity\n> \n>  builtin/log.c           |  4 +++-\n>  t/t4014-format-patch.sh | 21 +++++++++++++++++++++\n>  2 files changed, 24 insertions(+), 1 deletion(-)\n> \n> diff --git a/builtin/log.c b/builtin/log.c\n> index c0a8bb95e983..8bab30fcc70d 100644\n> --- a/builtin/log.c\n> +++ b/builtin/log.c\n> @@ -2050,8 +2050,10 @@ int cmd_format_patch(int argc, const char\n> **argv, const char *prefix)\n>  \tif (cover_from_description_arg)\n>  \t\tcover_from_description_mode =\n> parse_cover_from_description(cover_from_description_arg);\n> \n> -\tif (rfc)\n> +\tif (rfc) {\n>  \t\tstrbuf_insertstr(&sprefix, 0, \"RFC \");\n> +\t\tsubject_prefix = 1;\n> +\t}\n> \n>  \tif (reroll_count) {\n>  \t\tstrbuf_addf(&sprefix, \" v%s\", reroll_count);\n> diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\n> index e37a1411ee24..90fe6d066cc0 100755\n> --- a/t/t4014-format-patch.sh\n> +++ b/t/t4014-format-patch.sh\n> @@ -1397,6 +1397,27 @@ test_expect_success '--rfc is argument order\n> independent' '\n>  \ttest_cmp expect actual\n>  '\n> \n> +test_expect_success '--subject-prefix=\"<non-empty>\" and -k cannot be\n> used together' '\n> +\techo \"fatal: options '\\''--subject-prefix/--rfc'\\'' and '\\''-k'\\''\n> cannot be used together\" >expect.err &&\n> +\ttest_must_fail git format-patch -1 --stdout\n> --subject-prefix=\"MYPREFIX\" -k >actual.out 2>actual.err &&\n> +\ttest_must_be_empty actual.out &&\n> +\ttest_cmp expect.err actual.err\n> +'\n> +\n> +test_expect_success '--subject-prefix=\"\" and -k cannot be used \n> together' '\n> +\techo \"fatal: options '\\''--subject-prefix/--rfc'\\'' and '\\''-k'\\''\n> cannot be used together\" >expect.err &&\n> +\ttest_must_fail git format-patch -1 --stdout --subject-prefix=\"\" -k\n> >actual.out 2>actual.err &&\n> +\ttest_must_be_empty actual.out &&\n> +\ttest_cmp expect.err actual.err\n> +'\n> +\n> +test_expect_success '--rfc and -k cannot be used together' '\n> +\techo \"fatal: options '\\''--subject-prefix/--rfc'\\'' and '\\''-k'\\''\n> cannot be used together\" >expect.err &&\n> +\ttest_must_fail git format-patch -1 --stdout --rfc -k >actual.out\n> 2>actual.err &&\n> +\ttest_must_be_empty actual.out &&\n> +\ttest_cmp expect.err actual.err\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"},{"id":"493196","messageId":"D0NYZ4A0TV6M.CF19YB1PFRSB@cmpwn.com","threadId":"61336","inReplyTo":"b4c6cbf5f3246ecd0cf27c7e87bf6dfc@manjaro.org","subject":"Re: [PATCH] format-patch: ensure that --rfc and -k are mutually exclusive","fromName":"Drew DeVault","fromEmail":"sir@cmpwn.com","sentAt":"2024-04-19T08:51:38Z","receivedAt":"2024-04-19T08:51:44Z","isPatch":true,"sender":{"key":"sir@cmpwn.com","avatar":"https://avatars.githubusercontent.com/u/1310872?v=4"},"body":"Reviewed-by: Drew DeVault <sir@cmpwn.com>\n"},{"id":"493197","messageId":"37e983e1b272f2cce31821c03510f8aa@manjaro.org","threadId":"61336","inReplyTo":"D0NYZ4A0TV6M.CF19YB1PFRSB@cmpwn.com","subject":"Re: [PATCH] format-patch: ensure that --rfc and -k are mutually exclusive","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-04-19T09:30:26Z","receivedAt":"2024-04-19T09:30:30Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"On 2024-04-19 10:51, Drew DeVault wrote:\n> Reviewed-by: Drew DeVault <sir@cmpwn.com>\n\nThanks!\n"},{"id":"493217","messageId":"0d584b86-0b48-4e7f-b81c-fdb672dac98b@app.fastmail.com","threadId":"61336","inReplyTo":"71d195c248879e7c46fac0e84c6b0a8aa90bd2c2.1713488563.git.dsimic@manjaro.org","subject":"Re: [PATCH] format-patch: ensure that --rfc and -k are mutually exclusive","fromName":"Kristoffer Haugsbakk","fromEmail":"code@khaugsbakk.name","sentAt":"2024-04-19T13:43:10Z","receivedAt":"2024-04-19T13:43:32Z","isPatch":true,"sender":{"key":"code@khaugsbakk.name","avatar":"https://avatars.githubusercontent.com/u/2229597?v=4"},"body":"On Fri, Apr 19, 2024, at 03:05, Dragan Simic wrote:\n> Fix a bug that allows the \"--rfc\" and \"-k\" options to be specified together\n> when \"git format-patch\" is executed, which was introduced in the commit\n> e0d7db7423a9 (\"format-patch: --rfc honors what --subject-prefix sets\").\n>\n> Add a couple of additional tests to t4014, to cover additional cases of\n> the mutual exclusivity between different \"git format-patch\" options.\n>\n> Signed-off-by: Dragan Simic <dsimic@manjaro.org>\n\nLooks good to me FWIW. Also very good description of the changes from\nthe previous version to this one.\n"},{"id":"493219","messageId":"xmqqo7a5mk8f.fsf@gitster.g","threadId":"61336","inReplyTo":"0d584b86-0b48-4e7f-b81c-fdb672dac98b@app.fastmail.com","subject":"Re: [PATCH] format-patch: ensure that --rfc and -k are mutually exclusive","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-04-19T15:43:12Z","receivedAt":"2024-04-19T15:43:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Kristoffer Haugsbakk\" <code@khaugsbakk.name> writes:\n\n> On Fri, Apr 19, 2024, at 03:05, Dragan Simic wrote:\n>> Fix a bug that allows the \"--rfc\" and \"-k\" options to be specified together\n>> when \"git format-patch\" is executed, which was introduced in the commit\n>> e0d7db7423a9 (\"format-patch: --rfc honors what --subject-prefix sets\").\n>>\n>> Add a couple of additional tests to t4014, to cover additional cases of\n>> the mutual exclusivity between different \"git format-patch\" options.\n>>\n>> Signed-off-by: Dragan Simic <dsimic@manjaro.org>\n>\n> Looks good to me FWIW. Also very good description of the changes from\n> the previous version to this one.\n\nYup, very easy to follow what changed and how.\n\nWill queue, thanks all.\n"},{"id":"493267","messageId":"2ffb6a2c888e5bc901e0c903c335d0f7@manjaro.org","threadId":"61336","inReplyTo":"0d584b86-0b48-4e7f-b81c-fdb672dac98b@app.fastmail.com","subject":"Re: [PATCH] format-patch: ensure that --rfc and -k are mutually exclusive","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-04-21T13:50:45Z","receivedAt":"2024-04-21T13:50:55Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"On 2024-04-19 15:43, Kristoffer Haugsbakk wrote:\n> On Fri, Apr 19, 2024, at 03:05, Dragan Simic wrote:\n>> Fix a bug that allows the \"--rfc\" and \"-k\" options to be specified \n>> together\n>> when \"git format-patch\" is executed, which was introduced in the \n>> commit\n>> e0d7db7423a9 (\"format-patch: --rfc honors what --subject-prefix \n>> sets\").\n>> \n>> Add a couple of additional tests to t4014, to cover additional cases \n>> of\n>> the mutual exclusivity between different \"git format-patch\" options.\n>> \n>> Signed-off-by: Dragan Simic <dsimic@manjaro.org>\n> \n> Looks good to me FWIW. Also very good description of the changes from\n> the previous version to this one.\n\nThank you!\n"},{"id":"493268","messageId":"1d7ee11f801f2754529256bbf4570fd3@manjaro.org","threadId":"61336","inReplyTo":"xmqqo7a5mk8f.fsf@gitster.g","subject":"Re: [PATCH] format-patch: ensure that --rfc and -k are mutually exclusive","fromName":"Dragan Simic","fromEmail":"dsimic@manjaro.org","sentAt":"2024-04-21T14:00:57Z","receivedAt":"2024-04-21T14:00:59Z","isPatch":true,"sender":{"key":"dsimic@manjaro.org","avatar":null},"body":"On 2024-04-19 17:43, Junio C Hamano wrote:\n> \"Kristoffer Haugsbakk\" <code@khaugsbakk.name> writes:\n> \n>> On Fri, Apr 19, 2024, at 03:05, Dragan Simic wrote:\n>>> Fix a bug that allows the \"--rfc\" and \"-k\" options to be specified \n>>> together\n>>> when \"git format-patch\" is executed, which was introduced in the \n>>> commit\n>>> e0d7db7423a9 (\"format-patch: --rfc honors what --subject-prefix \n>>> sets\").\n>>> \n>>> Add a couple of additional tests to t4014, to cover additional cases \n>>> of\n>>> the mutual exclusivity between different \"git format-patch\" options.\n>>> \n>>> Signed-off-by: Dragan Simic <dsimic@manjaro.org>\n>> \n>> Looks good to me FWIW. Also very good description of the changes from\n>> the previous version to this one.\n> \n> Yup, very easy to follow what changed and how.\n> \n> Will queue, thanks all.\n\nThank you!\n"}]}