diff mbox series

[GSoC,RFC,1/6] builtin/log: add subject-extra-prefix flag to format-patch

Message ID 20250303220029.10716-2-lucasseikioshiro@gmail.com (mailing list archive)
State New
Headers show
Series Add --subject-extra-prefix flag to format-patch | expand

Commit Message

Lucas Seiki Oshiro March 3, 2025, 10 p.m. UTC
Add a new flag --subject-extra-prefix to format-patch. This flag is
primarily targeted for new contributors that send emails with the suject
starting with "[Newbie]", "[FirstTimer]" or "[Newcomer]" and developers
from mentoring programs, which may start the subject with "[GSoC]",
"[Outreachy]" or similar.

Signed-off-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
---
 builtin/log.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/builtin/log.c b/builtin/log.c
index e41f88945e..95667c93ca 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -2036,6 +2036,7 @@  int cmd_format_patch(int argc,
 	struct strbuf rdiff2 = STRBUF_INIT;
 	struct strbuf rdiff_title = STRBUF_INIT;
 	const char *rfc = NULL;
+	const char *extra_prefix = NULL;
 	int creation_factor = -1;
 	const char *signature = git_version_string;
 	char *signature_to_free = NULL;
@@ -2079,6 +2080,9 @@  int cmd_format_patch(int argc,
 		OPT_CALLBACK_F(0, "subject-prefix", &cfg, N_("prefix"),
 			    N_("use [<prefix>] instead of [PATCH]"),
 			    PARSE_OPT_NONEG, subject_prefix_callback),
+		OPT_STRING(0, "subject-extra-prefix", &extra_prefix,
+			   N_("subject-extra-prefix"),
+			   N_("add an extra prefix at the beginning of the subject")),
 		OPT_CALLBACK_F('o', "output-directory", &output_directory,
 			    N_("dir"), N_("store resulting files in <dir>"),
 			    PARSE_OPT_NONEG, output_directory_callback),