X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-rev-list.c;h=facaff288dba2789f0637c4554bd130440e2a3da;hb=e02f1762b257c50124fc528e8b60bf16e8bb7acf;hp=11a7eae551601abcd1eddfae389b86fac462b9a7;hpb=8bb65883d164843d5bb7475281af09bae18ab22d;p=git.git diff --git a/builtin-rev-list.c b/builtin-rev-list.c index 11a7eae55..facaff288 100644 --- a/builtin-rev-list.c +++ b/builtin-rev-list.c @@ -17,7 +17,7 @@ #define COUNTED (1u<<16) static const char rev_list_usage[] = -"git-rev-list [OPTION] ... [ -- paths... ]\n" +"git rev-list [OPTION] ... [ -- paths... ]\n" " limiting output:\n" " --max-count=nr\n" " --max-age=epoch\n" @@ -178,7 +178,7 @@ static void finish_object(struct object_array_entry *p) static void show_object(struct object_array_entry *p) { /* An object with name "foo\n0000000..." can be used to - * confuse downstream git-pack-objects very badly. + * confuse downstream "git pack-objects" very badly. */ const char *ep = strchr(p->name, '\n'); @@ -575,23 +575,6 @@ static struct commit_list *find_bisection(struct commit_list *list, return best; } -static void read_revisions_from_stdin(struct rev_info *revs) -{ - char line[1000]; - - while (fgets(line, sizeof(line), stdin) != NULL) { - int len = strlen(line); - if (len && line[len - 1] == '\n') - line[--len] = 0; - if (!len) - break; - if (line[0] == '-') - die("options not supported in --stdin mode"); - if (handle_revision_arg(line, revs, 0, 1)) - die("bad revision '%s'", line); - } -} - int cmd_rev_list(int argc, const char **argv, const char *prefix) { struct commit_list *list; @@ -607,6 +590,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) revs.commit_format = CMIT_FMT_UNSPECIFIED; argc = setup_revisions(argc, argv, &revs, NULL); + quiet = DIFF_OPT_TST(&revs.diffopt, QUIET); for (i = 1 ; i < argc; i++) { const char *arg = argv[i]; @@ -638,10 +622,6 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) read_revisions_from_stdin(&revs); continue; } - if (!strcmp(arg, "--quiet")) { - quiet = 1; - continue; - } usage(rev_list_usage); } @@ -665,7 +645,8 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) revs.diff) usage(rev_list_usage); - save_commit_buffer = revs.verbose_header || revs.grep_filter; + save_commit_buffer = revs.verbose_header || + revs.grep_filter.pattern_list; if (bisect_list) revs.limited = 1;