]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin-log.c
format-patch: Add format.subjectprefix config option
[thirdparty/git.git] / builtin-log.c
index a4186eac8ea395143d25b16b94171b3d4e75d444..5dc2c1c23061e4e25156a373c9692c026652b69a 100644 (file)
@@ -265,6 +265,7 @@ static int istitlechar(char c)
 
 static char *extra_headers = NULL;
 static int extra_headers_size = 0;
+static const char *fmt_patch_subject_prefix = "PATCH";
 static const char *fmt_patch_suffix = ".patch";
 
 static int git_format_config(const char *var, const char *value)
@@ -290,6 +291,13 @@ static int git_format_config(const char *var, const char *value)
        if (!strcmp(var, "diff.color") || !strcmp(var, "color.diff")) {
                return 0;
        }
+       if (!strcmp(var, "format.subjectprefix")) {
+               if (!value)
+                       die("format.subjectprefix without value");
+               fmt_patch_subject_prefix = xstrdup(value);
+               return 0;
+       }
+
        return git_log_config(var, value);
 }
 
@@ -459,6 +467,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
        rev.diffopt.msg_sep = "";
        rev.diffopt.recursive = 1;
 
+       rev.subject_prefix = fmt_patch_subject_prefix;
        rev.extra_headers = extra_headers;
 
        /*