Merge branch 'pw/sequence-rerere-autoupdate' into next
[gitweb.git] / builtin / rev-list.c
index 95d84d5cda1bdb6a699bc74ad57f7f1910946440..95b4128250c850eb130fbdfea2407bad819a85b8 100644 (file)
@@ -11,6 +11,7 @@
 #include "graph.h"
 #include "bisect.h"
 #include "progress.h"
+#include "reflog-walk.h"
 
 static const char rev_list_usage[] =
 "git rev-list [OPTION] <commit-id>... [ -- paths... ]\n"
@@ -122,6 +123,7 @@ static void show_commit(struct commit *commit, void *data)
                ctx.date_mode_explicit = revs->date_mode_explicit;
                ctx.fmt = revs->commit_format;
                ctx.output_encoding = get_log_output_encoding();
+               ctx.color = revs->diffopt.use_color;
                pretty_print_commit(&ctx, commit, &buf);
                if (buf.len) {
                        if (revs->commit_format != CMIT_FMT_ONELINE)
@@ -348,9 +350,10 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
                /* Only --header was specified */
                revs.commit_format = CMIT_FMT_RAW;
 
-       if ((!revs.commits &&
+       if ((!revs.commits && reflog_walk_empty(revs.reflog_info) &&
             (!(revs.tag_objects || revs.tree_objects || revs.blob_objects) &&
-             !revs.pending.nr)) ||
+             !revs.pending.nr) &&
+            !revs.rev_input_given) ||
            revs.diff)
                usage(rev_list_usage);