read_directory(): further split treat_path()
[gitweb.git] / builtin-rev-list.c
index 35f88ca425f8c960a7c1d76a18191c92fc118125..cd97ded4d249b3beb5179150a283e8be43b9ba44 100644 (file)
@@ -96,9 +96,10 @@ static void show_commit(struct commit *commit, void *data)
 
        if (revs->verbose_header && commit->buffer) {
                struct strbuf buf = STRBUF_INIT;
-               pretty_print_commit(revs->commit_format, commit,
-                                   &buf, revs->abbrev, NULL, NULL,
-                                   revs->date_mode, 0);
+               struct pretty_print_context ctx = {0};
+               ctx.abbrev = revs->abbrev;
+               ctx.date_mode = revs->date_mode;
+               pretty_print_commit(revs->commit_format, commit, &buf, &ctx);
                if (revs->graph) {
                        if (buf.len) {
                                if (revs->commit_format != CMIT_FMT_ONELINE)
@@ -235,26 +236,26 @@ void print_commit_list(struct commit_list *list,
        }
 }
 
-static void show_tried_revs(struct commit_list *tried, int stringed)
+static void show_tried_revs(struct commit_list *tried)
 {
        printf("bisect_tried='");
        print_commit_list(tried, "%s|", "%s");
-       printf(stringed ? "' &&\n" : "'\n");
+       printf("'\n");
 }
 
-static void print_var_str(const char *var, const char *val, int stringed)
+static void print_var_str(const char *var, const char *val)
 {
-       printf("%s='%s'%s\n", var, val, stringed ? " &&" : "");
+       printf("%s='%s'\n", var, val);
 }
 
-static void print_var_int(const char *var, int val, int stringed)
+static void print_var_int(const char *var, int val)
 {
-       printf("%s=%d%s\n", var, val, stringed ? " &&" : "");
+       printf("%s=%d\n", var, val);
 }
 
 int show_bisect_vars(struct rev_list_info *info, int reaches, int all)
 {
-       int cnt, stringed, flags = info->bisect_show_flags;
+       int cnt, flags = info->bisect_show_flags;
        char hex[41] = "";
        struct commit_list *tried;
        struct rev_info *revs = info->revs;
@@ -262,7 +263,9 @@ int show_bisect_vars(struct rev_list_info *info, int reaches, int all)
        if (!revs->commits && !(flags & BISECT_SHOW_TRIED))
                return 1;
 
-       revs->commits = filter_skipped(revs->commits, &tried, flags & BISECT_SHOW_ALL);
+       revs->commits = filter_skipped(revs->commits, &tried,
+                                      flags & BISECT_SHOW_ALL,
+                                      NULL, NULL);
 
        /*
         * revs->commits can reach "reaches" commits among
@@ -285,17 +288,15 @@ int show_bisect_vars(struct rev_list_info *info, int reaches, int all)
                printf("------\n");
        }
 
-       stringed = flags & BISECT_SHOW_STRINGED;
-
        if (flags & BISECT_SHOW_TRIED)
-               show_tried_revs(tried, stringed);
+               show_tried_revs(tried);
 
-       print_var_str("bisect_rev", hex, stringed);
-       print_var_int("bisect_nr", cnt - 1, stringed);
-       print_var_int("bisect_good", all - reaches - 1, stringed);
-       print_var_int("bisect_bad", reaches - 1, stringed);
-       print_var_int("bisect_all", all, stringed);
-       print_var_int("bisect_steps", estimate_bisect_steps(all), 0);
+       print_var_str("bisect_rev", hex);
+       print_var_int("bisect_nr", cnt - 1);
+       print_var_int("bisect_good", all - reaches - 1);
+       print_var_int("bisect_bad", reaches - 1);
+       print_var_int("bisect_all", all);
+       print_var_int("bisect_steps", estimate_bisect_steps(all));
 
        return 0;
 }
@@ -305,7 +306,6 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
        struct rev_info revs;
        struct rev_list_info info;
        int i;
-       int read_from_stdin = 0;
        int bisect_list = 0;
        int bisect_show_vars = 0;
        int bisect_find_all = 0;
@@ -319,8 +319,10 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
 
        memset(&info, 0, sizeof(info));
        info.revs = &revs;
+       if (revs.bisect)
+               bisect_list = 1;
 
-       quiet = DIFF_OPT_TST(&revs.diffopt, QUIET);
+       quiet = DIFF_OPT_TST(&revs.diffopt, QUICK);
        for (i = 1 ; i < argc; i++) {
                const char *arg = argv[i];
 
@@ -348,12 +350,6 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
                        bisect_show_vars = 1;
                        continue;
                }
-               if (!strcmp(arg, "--stdin")) {
-                       if (read_from_stdin++)
-                               die("--stdin given twice?");
-                       read_revisions_from_stdin(&revs);
-                       continue;
-               }
                usage(rev_list_usage);
 
        }