@matheusbsbs / matheus-bagliano / commits / 72276a3ecb
Fork 0

rev-list --children

Just like --parents option shows the parents of commits, this shows the children of commits. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Apr 3, 2008 at 23:01 UTC 72276a3ecbe6353b83ab37e0ce96cc21c94cf6ee
2 files changed +14
Documentation/rev-list-options.txt
+4
@@ -42,6 +42,10 @@ format, often found in E-mail messages.
42
43 Print the parents of the commit.
44
45 +--children::
46 +
47 + Print the children of the commit.
48 +
49 --timestamp::
50 Print the raw commit timestamp.
51
builtin-rev-list.c
+10
@@ -36,6 +36,7 @@ static const char rev_list_usage[] =
36 " --reverse\n"
37 " formatting output:\n"
38 " --parents\n"
39 +" --children\n"
40 " --objects | --objects-edge\n"
41 " --unpacked\n"
42 " --header | --pretty\n"
@@ -84,6 +85,15 @@ static void show_commit(struct commit *commit)
85 parents = parents->next;
86 }
87 }
88 + if (revs.children.name) {
89 + struct commit_list *children;
90 +
91 + children = lookup_decoration(&revs.children, &commit->object);
92 + while (children) {
93 + printf(" %s", sha1_to_hex(children->item->object.sha1));
94 + children = children->next;
95 + }
96 + }
97 show_decorations(commit);
98 if (revs.commit_format == CMIT_FMT_ONELINE)
99 putchar(' ');