{"thread":{"id":"63053","subject":"[GSoC][RFC PATCH 0/6] Add --subject-extra-prefix flag to format-patch","startedAt":"2025-03-03T22:00:58Z","lastAt":"2025-03-05T14:26:46Z","messageCount":15,"participants":["Lucas Seiki Oshiro","Eric Sunshine","Junio C Hamano","Patrick Steinhardt"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"513474","messageId":"20250303220029.10716-1-lucasseikioshiro@gmail.com","threadId":"63053","inReplyTo":null,"subject":"[GSoC][RFC PATCH 0/6] Add --subject-extra-prefix flag to format-patch","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2025-03-03T22:00:23Z","receivedAt":"2025-03-03T22:00:58Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Hi!\n\nThis is a \"scratch-my-own-itch\" patch, adding a new flag to format-patch. This\nflag allows the user add an extra prefix to the subject, placed before the\nactual prefix, like the \"[GSoC]\" in the subject of this patchset.\n\nThis is specially targeted for new users or developers from mentoring projects\nlike GSoC or Outreachy. Currently, if we want to add to the subject something\nlike \"[Newbie]\", \"[GSoC]\" or \"[Outreachy]\", we need to perform some hacks like\npassing --subject-prefix=\"GSoC][PATCH\" or changing it manually in the patch\ncontent. \n\nWith this new flag, this patchset could be created by using:\n\n`git format-patch -6 --subject-extra-prefix=\"GSoC\" --rfc --to=\"...\"`\n\nThis would be only a feature request but I thought it would be better to \npresent a first solution, so I'm sending my implementation as a RFC patchset.\n\nThanks!\n\nLucas Seiki Oshiro (6):\n  builtin/log: add subject-extra-prefix flag to format-patch\n  builtin/log: die if -k and --suject-extra-prefix are used together\n  revision: add subject_extra_field to struct rev_info\n  builtin/log: fill subject extra prefix in format-patch\n  log-tree: add subject prefix in output email subject\n  t4014: add tests for the new flag --subject-extra-prefix\n\n builtin/log.c           |  7 +++++++\n log-tree.c              | 12 ++++++++----\n revision.h              |  2 ++\n t/t4014-format-patch.sh | 40 ++++++++++++++++++++++++++++++++++++++++\n 4 files changed, 57 insertions(+), 4 deletions(-)\n\n-- \n2.39.5 (Apple Git-154)\n\n"},{"id":"513475","messageId":"20250303220029.10716-2-lucasseikioshiro@gmail.com","threadId":"63053","inReplyTo":"20250303220029.10716-1-lucasseikioshiro@gmail.com","subject":"[GSoC][RFC PATCH 1/6] builtin/log: add subject-extra-prefix flag to format-patch","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2025-03-03T22:00:24Z","receivedAt":"2025-03-03T22:01:20Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Add a new flag --subject-extra-prefix to format-patch. This flag is\nprimarily targeted for new contributors that send emails with the suject\nstarting with \"[Newbie]\", \"[FirstTimer]\" or \"[Newcomer]\" and developers\nfrom mentoring programs, which may start the subject with \"[GSoC]\",\n\"[Outreachy]\" or similar.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n builtin/log.c | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/builtin/log.c b/builtin/log.c\nindex e41f88945e..95667c93ca 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -2036,6 +2036,7 @@ int cmd_format_patch(int argc,\n \tstruct strbuf rdiff2 = STRBUF_INIT;\n \tstruct strbuf rdiff_title = STRBUF_INIT;\n \tconst char *rfc = NULL;\n+\tconst char *extra_prefix = NULL;\n \tint creation_factor = -1;\n \tconst char *signature = git_version_string;\n \tchar *signature_to_free = NULL;\n@@ -2079,6 +2080,9 @@ int cmd_format_patch(int argc,\n \t\tOPT_CALLBACK_F(0, \"subject-prefix\", &cfg, N_(\"prefix\"),\n \t\t\t    N_(\"use [<prefix>] instead of [PATCH]\"),\n \t\t\t    PARSE_OPT_NONEG, subject_prefix_callback),\n+\t\tOPT_STRING(0, \"subject-extra-prefix\", &extra_prefix,\n+\t\t\t   N_(\"subject-extra-prefix\"),\n+\t\t\t   N_(\"add an extra prefix at the beginning of the subject\")),\n \t\tOPT_CALLBACK_F('o', \"output-directory\", &output_directory,\n \t\t\t    N_(\"dir\"), N_(\"store resulting files in <dir>\"),\n \t\t\t    PARSE_OPT_NONEG, output_directory_callback),\n-- \n2.39.5 (Apple Git-154)\n\n"},{"id":"513476","messageId":"20250303220029.10716-3-lucasseikioshiro@gmail.com","threadId":"63053","inReplyTo":"20250303220029.10716-1-lucasseikioshiro@gmail.com","subject":"[GSoC][RFC PATCH 2/6] builtin/log: die if -k and --suject-extra-prefix are used together","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2025-03-03T22:00:25Z","receivedAt":"2025-03-03T22:01:33Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"When calling format-patch, -k keeps the commit title as the patch subject\nand can't be used with other options that depend on the existence of a\nprefix. This way, -k shouldn't also be used with --subject-extra-prefix,\nas it introduces an extra prefix.\n\nIf -k and --subject-extra-prefix are used together, die.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n builtin/log.c | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 95667c93ca..52dc0301cf 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -2256,6 +2256,8 @@ int cmd_format_patch(int argc,\n \t\tdie(_(\"options '%s' and '%s' cannot be used together\"), \"-n\", \"-k\");\n \tif (cfg.keep_subject && cfg.subject_prefix)\n \t\tdie(_(\"options '%s' and '%s' cannot be used together\"), \"--subject-prefix/--rfc\", \"-k\");\n+\tif (cfg.keep_subject && extra_prefix)\n+\t\tdie(_(\"options '%s' and '%s' cannot be used together\"), \"--subject-extra-prefix\", \"-k\");\n \trev.preserve_subject = cfg.keep_subject;\n \n \targc = setup_revisions(argc, argv, &rev, &s_r_opt);\n-- \n2.39.5 (Apple Git-154)\n\n"},{"id":"513477","messageId":"20250303220029.10716-4-lucasseikioshiro@gmail.com","threadId":"63053","inReplyTo":"20250303220029.10716-1-lucasseikioshiro@gmail.com","subject":"[GSoC][RFC PATCH 3/6] revision: add subject_extra_field to struct rev_info","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2025-03-03T22:00:26Z","receivedAt":"2025-03-03T22:01:43Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Currently, the `struct rev_info` is responsible for holding information\nabout the prefix that is added at the beginning of the subject when\n`format-patch` is called. This way, it makes sense that it also holds\nthe information of the extra prefix, if it is present.\n\nAdd a new field called `subject_extra_field` to `struct rev_info` and\nuse NULL as its default value.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n revision.h | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/revision.h b/revision.h\nindex 71e984c452..70927ef1fb 100644\n--- a/revision.h\n+++ b/revision.h\n@@ -294,6 +294,7 @@ struct rev_info {\n \tconst char\t*extra_headers;\n \tconst char\t*log_reencode;\n \tconst char\t*subject_prefix;\n+\tconst char\t*subject_extra_prefix;\n \tint\t\tpatch_name_max;\n \tint\t\tno_inline;\n \tint\t\tshow_log_size;\n@@ -413,6 +414,7 @@ struct rev_info {\n \t.expand_tabs_in_log = -1, \\\n \t.commit_format = CMIT_FMT_DEFAULT, \\\n \t.expand_tabs_in_log_default = 8, \\\n+        .subject_extra_prefix = NULL, \\\n }\n \n /**\n-- \n2.39.5 (Apple Git-154)\n\n"},{"id":"513478","messageId":"20250303220029.10716-5-lucasseikioshiro@gmail.com","threadId":"63053","inReplyTo":"20250303220029.10716-1-lucasseikioshiro@gmail.com","subject":"[GSoC][RFC PATCH 4/6] builtin/log: fill subject extra prefix in format-patch","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2025-03-03T22:00:27Z","receivedAt":"2025-03-03T22:01:50Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Since the `struct rev_info` is the responsible of holding the subject extra\nprefix string, copy to its `subject_extra_prefix` field the string provided\nby --subject-extra-prefix when calling `format-patch`.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n builtin/log.c | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/builtin/log.c b/builtin/log.c\nindex 52dc0301cf..034ad44ef0 100644\n--- a/builtin/log.c\n+++ b/builtin/log.c\n@@ -2205,6 +2205,7 @@ int cmd_format_patch(int argc,\n \t\trev.reroll_count = reroll_count;\n \t}\n \n+\trev.subject_extra_prefix = extra_prefix;\n \trev.subject_prefix = cfg.sprefix.buf;\n \n \tfor (i = 0; i < cfg.extra_hdr.nr; i++) {\n-- \n2.39.5 (Apple Git-154)\n\n"},{"id":"513479","messageId":"20250303220029.10716-6-lucasseikioshiro@gmail.com","threadId":"63053","inReplyTo":"20250303220029.10716-1-lucasseikioshiro@gmail.com","subject":"[GSoC][RFC PATCH 5/6] log-tree: add subject prefix in output email subject","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2025-03-03T22:00:28Z","receivedAt":"2025-03-03T22:01:57Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"When an extra subject prefix is provided by the user when calling\n`format-patch --subject-extra-prefix`, insert it between brackets at the\nbeginning of the the patch subject. Don't change the behavior when this\nflag is not used.\n\nFor example, this `format-patch` call:\n\n`git format-patch -1 --subject-extra-prefix EXTRA -n -v2`\n\nwill create a patch with the subject beginning with:\n\n`Subject: [EXTRA][PATCH v2 1/1]`\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n log-tree.c | 12 ++++++++----\n 1 file changed, 8 insertions(+), 4 deletions(-)\n\ndiff --git a/log-tree.c b/log-tree.c\nindex 8b184d6776..d72ab25585 100644\n--- a/log-tree.c\n+++ b/log-tree.c\n@@ -478,17 +478,21 @@ void fmt_output_commit(struct strbuf *filename,\n \n void fmt_output_email_subject(struct strbuf *sb, struct rev_info *opt)\n {\n+\tstrbuf_addstr(sb, \"Subject: \");\n+\n+\tif (opt->subject_extra_prefix && *opt->subject_extra_prefix)\n+\t\tstrbuf_addf(sb, \"[%s]\",\n+\t\t\t    opt->subject_extra_prefix);\n+\n \tif (opt->total > 0) {\n-\t\tstrbuf_addf(sb, \"Subject: [%s%s%0*d/%d] \",\n+\t\tstrbuf_addf(sb, \"[%s%s%0*d/%d] \",\n \t\t\t    opt->subject_prefix,\n \t\t\t    *opt->subject_prefix ? \" \" : \"\",\n \t\t\t    decimal_width(opt->total),\n \t\t\t    opt->nr, opt->total);\n \t} else if (opt->total == 0 && opt->subject_prefix && *opt->subject_prefix) {\n-\t\tstrbuf_addf(sb, \"Subject: [%s] \",\n+\t\tstrbuf_addf(sb, \"[%s] \",\n \t\t\t    opt->subject_prefix);\n-\t} else {\n-\t\tstrbuf_addstr(sb, \"Subject: \");\n \t}\n }\n \n-- \n2.39.5 (Apple Git-154)\n\n"},{"id":"513480","messageId":"20250303220029.10716-7-lucasseikioshiro@gmail.com","threadId":"63053","inReplyTo":"20250303220029.10716-1-lucasseikioshiro@gmail.com","subject":"[GSoC][RFC PATCH 6/6] t4014: add tests for the new flag --subject-extra-prefix","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2025-03-03T22:00:29Z","receivedAt":"2025-03-03T22:02:02Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Add tests for `format-patch --subject-extra-prefix` asserting that it\nworks correctly in the following situations:\n\n- without other flags related to the prefix;\n\n- with the --rfc flag, which should add RFC to the prefix;\n\n- with the -n flag, which should add the numbering to the prefix;\n\n- with the -v flag, which should add the patch version to the prefix;\n\n- with the -k flag, diying as they aren't meant to be used together.\n\nSigned-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n---\n t/t4014-format-patch.sh | 40 ++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 40 insertions(+)\n\ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 884f83fb8a..1256ce2197 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -1444,6 +1444,46 @@ test_expect_success '--rfc and -k cannot be used together' '\n \ttest_cmp expect.err actual.err\n '\n \n+cat >expect <<'EOF'\n+Subject: [EXTRA][PATCH] header with . in it\n+EOF\n+test_expect_success '--subject-extra-prefix adds extra prefix' '\n+\tgit format-patch -1 --stdout --subject-extra-prefix=EXTRA >patch &&\n+\tgrep ^Subject: patch >actual &&\n+\ttest_cmp expect actual\n+'\n+\n+cat >expect <<'EOF'\n+Subject: [EXTRA][RFC PATCH] header with . in it\n+EOF\n+test_expect_success '--subject-extra-prefix works with --rfc' '\n+\tgit format-patch --rfc -1 --stdout --subject-extra-prefix=EXTRA >patch &&\n+\tgrep ^Subject: patch >actual &&\n+\ttest_cmp expect actual\n+'\n+\n+cat >expect <<'EOF'\n+Subject: [EXTRA][PATCH 1/1] header with . in it\n+EOF\n+test_expect_success '--subject-extra-prefix works with numbered patches' '\n+\tgit format-patch -n -1 --stdout --subject-extra-prefix=EXTRA >patch &&\n+\tgrep ^Subject: patch >actual &&\n+\ttest_cmp expect actual\n+'\n+\n+cat >expect <<'EOF'\n+Subject: [EXTRA][PATCH v2] header with . in it\n+EOF\n+test_expect_success '--subject-extra-prefix works with -v' '\n+\tgit format-patch -v2 -1 --stdout --subject-extra-prefix=EXTRA >patch &&\n+\tgrep ^Subject: patch >actual &&\n+\ttest_cmp expect actual\n+'\n+\n+test_expect_failure '--subject-extra-prefix does not run with -k' '\n+\tgit format-patch -k -1 --stdout --subject-extra-prefix=EXTRA >/dev/null\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-- \n2.39.5 (Apple Git-154)\n\n"},{"id":"513482","messageId":"CAPig+cTdNYDWzKgZsWadPiorZr-WB+53-ncPZC2nHTtzuPVp3g@mail.gmail.com","threadId":"63053","inReplyTo":"20250303220029.10716-3-lucasseikioshiro@gmail.com","subject":"Re: [GSoC][RFC PATCH 2/6] builtin/log: die if -k and --suject-extra-prefix are used together","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2025-03-03T22:36:17Z","receivedAt":"2025-03-03T22:36:29Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Mar 3, 2025 at 5:01 PM Lucas Seiki Oshiro\n<lucasseikioshiro@gmail.com> wrote:\n> builtin/log: die if -k and --suject-extra-prefix are used together\n\ns/suject/subject/\n\n> When calling format-patch, -k keeps the commit title as the patch subject\n> and can't be used with other options that depend on the existence of a\n> prefix. This way, -k shouldn't also be used with --subject-extra-prefix,\n> as it introduces an extra prefix.\n>\n> If -k and --subject-extra-prefix are used together, die.\n>\n> Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>\n"},{"id":"513484","messageId":"xmqq7c55vhj8.fsf@gitster.g","threadId":"63053","inReplyTo":"20250303220029.10716-1-lucasseikioshiro@gmail.com","subject":"Re: [GSoC][RFC PATCH 0/6] Add --subject-extra-prefix flag to format-patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-03-03T23:08:43Z","receivedAt":"2025-03-03T23:08:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:\n\n> Subject: Re: [GSoC][RFC PATCH 0/6] Add --subject-extra-prefix flag to format-patch\n\nHmph, instead use \"--rfc=GSoC\" to do [GSoC PATCH n/m] and please do\nnot pile more \"extra\" on top?\n\n"},{"id":"513500","messageId":"Z8aspywaD0mAyHwd@pks.im","threadId":"63053","inReplyTo":"xmqq7c55vhj8.fsf@gitster.g","subject":"Re: [GSoC][RFC PATCH 0/6] Add --subject-extra-prefix flag to format-patch","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-03-04T07:32:55Z","receivedAt":"2025-03-04T07:33:04Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Mon, Mar 03, 2025 at 03:08:43PM -0800, Junio C Hamano wrote:\n> Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:\n> \n> > Subject: Re: [GSoC][RFC PATCH 0/6] Add --subject-extra-prefix flag to format-patch\n> \n> Hmph, instead use \"--rfc=GSoC\" to do [GSoC PATCH n/m] and please do\n> not pile more \"extra\" on top?\n\nI do understand though that `--rfc=GSoC` is not exactly discoverable for\na newcomer. Maybe a simpler fix would be to introduce an alias for that\noption that is more discoverable? I don't have a great idea for how to\nname it -- the best that comes to mind is `--patch-prefix`, which\nmirrors `--subject-prefix`.\n\n    --patch-prefix=<prefix>\n    --rfc\n        Prepends the string `<prefix>` to the subject prefix. As the\n        subject prefix defaults to \"PATCH\", you’ll get \"<prefix> PATCH\"\n        by default.\n\n        When `--rfc` is given, the prefix will be set to \"RFC\" . RFC\n        means \"Request For Comments\"; use this when sending an\n        experimental patch for discussion rather than application.\n        \"--rfc=WIP\" may also be a useful way to indicate that a patch is\n        not complete yet (\"WIP\" stands for \"Work In Progress\").\n\n        If the convention of the receiving community for a particular\n        extra string is to have it after the subject prefix, the string\n        <prefix> can be prefixed with a dash (\"-\") to signal that the rest\n        of the <prefix> string should be appended to the subject prefix\n        instead, e.g., --patch-prefix='-(WIP)' results in \"PATCH (WIP)\".\n\nWe would hide away the optional value `[=<rfc>]` of the `--rfc` option\nand instead advertise `--patch-prefix=<prefix>`. This would of course\nonly be a cosmetic change, we'd still accept the optional argument so\nthat we don't break backwards compatibility.\n\nPatrick\n"},{"id":"513533","messageId":"xmqqfrjtt084.fsf@gitster.g","threadId":"63053","inReplyTo":"xmqq7c55vhj8.fsf@gitster.g","subject":"Re: [GSoC][RFC PATCH 0/6] Add --subject-extra-prefix flag to format-patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-03-04T13:05:31Z","receivedAt":"2025-03-04T13:05:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:\n>\n>> Subject: Re: [GSoC][RFC PATCH 0/6] Add --subject-extra-prefix flag to format-patch\n>\n> Hmph, instead use \"--rfc=GSoC\" to do [GSoC PATCH n/m] and please do\n> not pile more \"extra\" on top?\n\nOr even --subject-prefix=\"GSoC PATCH\".\n\nOnce you stop treating [GSoC] as if it is an independent prefix,\neverything will fall into place naturally without adding anything\nextra.\n\nTo put it differently, which one wastes more precious horizontal\nscreen estate on the Subject line, where practically only 50 or so\ncolumns are usable?\n\n    Subject: [A][B][C][D][PATCH 0/6] This is my first contribution\n    Subject: [A B C D PATCH 0/6] This is my first contribution\n\n\n"},{"id":"513577","messageId":"xmqq5xkoo3gs.fsf@gitster.g","threadId":"63053","inReplyTo":"Z8aspywaD0mAyHwd@pks.im","subject":"Re: [GSoC][RFC PATCH 0/6] Add --subject-extra-prefix flag to format-patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-03-04T22:06:43Z","receivedAt":"2025-03-04T22:06:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Patrick Steinhardt <ps@pks.im> writes:\n\n> I do understand though that `--rfc=GSoC` is not exactly discoverable for\n> a newcomer. Maybe a simpler fix would be to introduce an alias for that\n> option that is more discoverable? I don't have a great idea for how to\n> name it -- the best that comes to mind is `--patch-prefix`, which\n> mirrors `--subject-prefix`.\n\nThe problem with it is that having \"patch\" vs \"subject\" prefix will\nmake it confusing which one is which.\n\nLet's step back and examine what we already have.\n\n * The \"--subject-prefix\" is configurable and format.subjectPrefix\n   is meant to go to .git/config for repositories that work with\n   projects with special needs (they tell you to use not [PATCH] but\n   subproject specific moniker like [PATCH rcu] instead).\n\n * The \"--rfc[=<word>]\" has no configuration and it is deliberately\n   so, as it is meant to be used as needed, on occasions that call\n   for it, pretty much decided per invocation.\n\nAre these two points above not clear in our documentation?  If so,\nwe should fix it, but I do not think giving a synonym to --rfc is a\ngood way to clarify it.\n\nIf it is a GSoC topic sent to this list, it _will_ be GSoC topic for\nthe entire iterations of the same topic.  So it would be good to use\n--subject-prefix=\"GSoC PATCH\" (or configure format.subjectPrefix in\nthe repository to use that, if a student works with us only on GSoC\ntopics during the Summer-of-Code program duration), and on occasion,\nwhen students are not so sure about their patches (yet), use of --rfc\nwould be a good way, which would give us \"[RFC GSoC PATCH 0/6]\", to\nmark the patches as such.\n\nAnother problem with --patch-prefix synonym is that --rfc is not\nnecessarily a prefix.  With\n\n\tgit format-patch --rfc='-WIP' --subject-prefix='GSoC PATCH'\n\nyou would get \"[GSoC PATCH WIP 0/6]\" instead.\n\nIn any case, I think it is the root cause of this disease to treat\nGSoC mark as something extra that requires a new marker that is\nseparate from the usual PATCH marker.  Using whatever mechanism you\nwould use your string in place for the standard PATCH mark to make\nit say \"GSoC PATCH\" would be the most appropriate, without mucking\nwith an extra option, be it '--rfc' or '--subject-extra-prefix', I\nwould say.\n\nThanks.\n"},{"id":"513581","messageId":"7350D94E-39DC-4C9B-926A-3FA2A4C76687@gmail.com","threadId":"63053","inReplyTo":"xmqqfrjtt084.fsf@gitster.g","subject":"Re: [GSoC][RFC PATCH 0/6] Add --subject-extra-prefix flag to format-patch","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2025-03-04T23:19:43Z","receivedAt":"2025-03-04T23:19:58Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"\n> Once you stop treating [GSoC] as if it is an independent prefix,\n> everything will fall into place naturally without adding anything\n> extra.\n\nSo, instead of changing the behavior of format-patch, would it be\nbetter if we changed the documentation to ask these patches to be\nsent with `[GSoC PATCH]` or similar instead of `[GSoC][PATCH]`?\n\nI mean, in\nhttps://git.github.io/General-Microproject-Information/ :\n\n\"\"\"\nWhen you submit your patch, please mention that you plan to apply\nfor the GSoC or Outreachy. You can use \"[GSoC][PATCH ...]\" or \n\"[Outreachy][PATCH ...]\" in the subject of the emails you send for\nthat purpose.\n\"\"\"\n"},{"id":"513595","messageId":"xmqqo6ygmdst.fsf@gitster.g","threadId":"63053","inReplyTo":"7350D94E-39DC-4C9B-926A-3FA2A4C76687@gmail.com","subject":"Re: [GSoC][RFC PATCH 0/6] Add --subject-extra-prefix flag to format-patch","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-03-05T02:06:26Z","receivedAt":"2025-03-05T02:06:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:\n\n>> Once you stop treating [GSoC] as if it is an independent prefix,\n>> everything will fall into place naturally without adding anything\n>> extra.\n>\n> So, instead of changing the behavior of format-patch, would it be\n> better if we changed the documentation to ask these patches to be\n> sent with `[GSoC PATCH]` or similar instead of `[GSoC][PATCH]`?\n\nYup, I do not know offhand who are managing these descriptions, but\nhaving extra moniker in the same [square bracket] as PATCH is a more\ncommon practice, and we should follow suit.\n\nThanks.\n"},{"id":"513602","messageId":"8A65813C-4D58-4817-AA84-A2449AF09E40@gmail.com","threadId":"63053","inReplyTo":"xmqqo6ygmdst.fsf@gitster.g","subject":"Re: [GSoC][RFC PATCH 0/6] Add --subject-extra-prefix flag to format-patch","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2025-03-05T14:26:32Z","receivedAt":"2025-03-05T14:26:46Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"\n> Yup, I do not know offhand who are managing these descriptions, but\n> having extra moniker in the same [square bracket] as PATCH is a more\n> common practice, and we should follow suit.\n\nOk, thanks!\n\nI just created a PR in git.github.io <http://git.github.io/> replacing the mentions of \n`[GSoC][PATCH]` by `[GSoC PATCH]`:\n\nhttps://github.com/git/git.github.io/pull/756\n\n"}]}