X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-rev-list.c;h=8e1720c45bfa2ffc170b9880a6c90fcc3741bd46;hb=0513f241cc2d757371dc7ba6b065366de044862e;hp=54d55cc3a33e55d5c3021eae14b7a771b4e1c23f;hpb=58dd4915ba1a933af0087e351743e31b2f9be878;p=git.git diff --git a/builtin-rev-list.c b/builtin-rev-list.c index 54d55cc3a..8e1720c45 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" @@ -37,6 +37,7 @@ static const char rev_list_usage[] = " --reverse\n" " formatting output:\n" " --parents\n" +" --children\n" " --objects | --objects-edge\n" " --unpacked\n" " --header | --pretty\n" @@ -65,15 +66,18 @@ static void show_commit(struct commit *commit) printf("%lu ", commit->date); if (header_prefix) fputs(header_prefix, stdout); - if (commit->object.flags & BOUNDARY) - putchar('-'); - else if (commit->object.flags & UNINTERESTING) - putchar('^'); - else if (revs.left_right) { - if (commit->object.flags & SYMMETRIC_LEFT) - putchar('<'); - else - putchar('>'); + + if (!revs.graph) { + if (commit->object.flags & BOUNDARY) + putchar('-'); + else if (commit->object.flags & UNINTERESTING) + putchar('^'); + else if (revs.left_right) { + if (commit->object.flags & SYMMETRIC_LEFT) + putchar('<'); + else + putchar('>'); + } } if (revs.abbrev_commit && revs.abbrev) fputs(find_unique_abbrev(commit->object.sha1, revs.abbrev), @@ -87,6 +91,15 @@ static void show_commit(struct commit *commit) parents = parents->next; } } + if (revs.children.name) { + struct commit_list *children; + + children = lookup_decoration(&revs.children, &commit->object); + while (children) { + printf(" %s", sha1_to_hex(children->item->object.sha1)); + children = children->next; + } + } show_decorations(commit); if (revs.commit_format == CMIT_FMT_ONELINE) putchar(' '); @@ -562,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; @@ -588,7 +584,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix) int bisect_find_all = 0; int quiet = 0; - git_config(git_default_config); + git_config(git_default_config, NULL); init_revisions(&revs, prefix); revs.abbrev = 0; revs.commit_format = CMIT_FMT_UNSPECIFIED;