Merge branch 'jc/bindiff' into next
[gitweb.git] / rev-list.c
index 33741ebbc4eec2ab7abdd9b5c045c7a6ec3cada6..235ae4c7e13b7dd26af100c6a1411ebfdeaef354 100644 (file)
@@ -8,9 +8,9 @@
 #include "diff.h"
 #include "revision.h"
 
-/* bits #0-6 in revision.h */
+/* bits #0-15 in revision.h */
 
-#define COUNTED                (1u<<7)
+#define COUNTED                (1u<<16)
 
 static const char rev_list_usage[] =
 "git-rev-list [OPTION] <commit-id>... [ -- paths... ]\n"
@@ -41,13 +41,14 @@ struct rev_info revs;
 static int bisect_list = 0;
 static int show_timestamp = 0;
 static int hdr_termination = 0;
+static const char *header_prefix;
 
 static void show_commit(struct commit *commit)
 {
        if (show_timestamp)
                printf("%lu ", commit->date);
-       if (*revs.header_prefix)
-               fputs(revs.header_prefix, stdout);
+       if (header_prefix)
+               fputs(header_prefix, stdout);
        if (commit->object.flags & BOUNDARY)
                putchar('-');
        if (revs.abbrev_commit && revs.abbrev)
@@ -83,7 +84,7 @@ static void show_commit(struct commit *commit)
                static char pretty_header[16384];
                pretty_print_commit(revs.commit_format, commit, ~0,
                                    pretty_header, sizeof(pretty_header),
-                                   revs.abbrev);
+                                   revs.abbrev, NULL);
                printf("%s%c", pretty_header, hdr_termination);
        }
        fflush(stdout);
@@ -322,10 +323,13 @@ int main(int argc, const char **argv)
                /* The command line has a --pretty  */
                hdr_termination = '\n';
                if (revs.commit_format == CMIT_FMT_ONELINE)
-                       revs.header_prefix = "";
+                       header_prefix = "";
                else
-                       revs.header_prefix = "commit ";
+                       header_prefix = "commit ";
        }
+       else if (revs.verbose_header)
+               /* Only --header was specified */
+               revs.commit_format = CMIT_FMT_RAW;
 
        list = revs.commits;