]> git.ipfire.org Git - thirdparty/git.git/blobdiff - range-diff.c
gitweb: correctly store previous rev in javascript-actions mode
[thirdparty/git.git] / range-diff.c
index 7a96a587f1f378ce25c2d1dc1491ec841e276e99..ba1e9a4265a6cb3e6ae77b2f32f9fd64bee04cc6 100644 (file)
@@ -139,8 +139,10 @@ static int read_patches(const char *range, struct string_list *list)
                        strbuf_addstr(&buf, " ##");
                } else if (in_header) {
                        if (starts_with(line, "Author: ")) {
+                               strbuf_addstr(&buf, " ## Metadata ##\n");
                                strbuf_addstr(&buf, line);
                                strbuf_addstr(&buf, "\n\n");
+                               strbuf_addstr(&buf, " ## Commit message ##\n");
                        } else if (starts_with(line, "    ")) {
                                p = line + len - 2;
                                while (isspace(*p) && p >= line)
@@ -402,8 +404,9 @@ static void output_pair_header(struct diff_options *diffopt,
        fwrite(buf->buf, buf->len, 1, diffopt->file);
 }
 
-static struct userdiff_driver no_func_name = {
-       .funcname = { "$^", 0 }
+static struct userdiff_driver section_headers = {
+       .funcname = { "^ ## (.*) ##$\n"
+                     "^.?@@ (.*)$", REG_EXTENDED }
 };
 
 static struct diff_filespec *get_filespec(const char *name, const char *p)
@@ -415,7 +418,7 @@ static struct diff_filespec *get_filespec(const char *name, const char *p)
        spec->size = strlen(p);
        spec->should_munmap = 0;
        spec->is_stdin = 1;
-       spec->driver = &no_func_name;
+       spec->driver = &section_headers;
 
        return spec;
 }