Code

Merge branch 'maint'
[git.git] / builtin-rev-list.c
index 39ec61c42858c0b1c5306025f0962b3ee3d7f910..893762c80f4910fadf2d6df414bd835cccb7faaa 100644 (file)
@@ -17,7 +17,7 @@
 #define COUNTED                (1u<<16)
 
 static const char rev_list_usage[] =
-"git-rev-list [OPTION] <commit-id>... [ -- paths... ]\n"
+"git rev-list [OPTION] <commit-id>... [ -- 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"
@@ -90,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(' ');
@@ -565,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;