{"thread":{"id":"8857","subject":"[PATCH] Handle format.subjectprefix for every command which accepts --pretty","startedAt":"2007-07-04T10:42:10Z","lastAt":"2007-07-04T10:42:10Z","messageCount":1,"participants":["Alex Riesen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"46462","messageId":"81b0412b0707040342m22d3979cte99601bc1117f065@mail.gmail.com","threadId":"8857","inReplyTo":null,"subject":"[PATCH] Handle format.subjectprefix for every command which accepts --pretty","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-07-04T10:42:10Z","receivedAt":"2007-07-04T10:42:10Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Because the --pretty can be given as --pretty=email which historically produced\nmails with patches. IOW, exactly what git-format-patch does.\n\nSigned-off-by: Alex Riesen <raa.lkml@gmail.com>\n---\n builtin-log.c |   15 ++++++++-------\n 1 files changed, 8 insertions(+), 7 deletions(-)\n\n\nFrom 3c8b524c775a96eb0e9b638e3c0b194d8743594a Mon Sep 17 00:00:00 2001\nFrom: Alex Riesen <raa@limbo.localdomain>\nDate: Wed, 4 Jul 2007 12:37:27 +0200\nSubject: [PATCH] Handle format.subjectprefix for every command which accepts --pretty\n\nBecause the --pretty can be given as --pretty=email which historically produced\nmails with patches. IOW, exactly what git-format-patch does.\n---\n builtin-log.c |   15 ++++++++-------\n 1 files changed, 8 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin-log.c b/builtin-log.c\nindex 5dc2c1c..13bae31 100644\n--- a/builtin-log.c\n+++ b/builtin-log.c\n@@ -16,6 +16,7 @@\n #include \"refs.h\"\n \n static int default_show_root = 1;\n+static const char *fmt_patch_subject_prefix = \"PATCH\";\n \n /* this is in builtin-diff.c */\n void add_head(struct rev_info *revs);\n@@ -55,6 +56,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,\n \trev->commit_format = CMIT_FMT_DEFAULT;\n \trev->verbose_header = 1;\n \trev->show_root_diff = default_show_root;\n+\trev->subject_prefix = fmt_patch_subject_prefix;\n \targc = setup_revisions(argc, argv, rev, \"HEAD\");\n \tif (rev->diffopt.pickaxe || rev->diffopt.filter)\n \t\trev->always_show_header = 0;\n@@ -94,6 +96,12 @@ static int cmd_log_walk(struct rev_info *rev)\n \n static int git_log_config(const char *var, const char *value)\n {\n+\tif (!strcmp(var, \"format.subjectprefix\")) {\n+\t\tif (!value)\n+\t\t\tdie(\"format.subjectprefix without value\");\n+\t\tfmt_patch_subject_prefix = xstrdup(value);\n+\t\treturn 0;\n+\t}\n \tif (!strcmp(var, \"log.showroot\")) {\n \t\tdefault_show_root = git_config_bool(var, value);\n \t\treturn 0;\n@@ -265,7 +273,6 @@ static int istitlechar(char c)\n \n static char *extra_headers = NULL;\n static int extra_headers_size = 0;\n-static const char *fmt_patch_subject_prefix = \"PATCH\";\n static const char *fmt_patch_suffix = \".patch\";\n \n static int git_format_config(const char *var, const char *value)\n@@ -291,12 +298,6 @@ static int git_format_config(const char *var, const char *value)\n \tif (!strcmp(var, \"diff.color\") || !strcmp(var, \"color.diff\")) {\n \t\treturn 0;\n \t}\n-\tif (!strcmp(var, \"format.subjectprefix\")) {\n-\t\tif (!value)\n-\t\t\tdie(\"format.subjectprefix without value\");\n-\t\tfmt_patch_subject_prefix = xstrdup(value);\n-\t\treturn 0;\n-\t}\n \n \treturn git_log_config(var, value);\n }\n-- \n1.5.2.2.669.gad316\n\n"}]}