summaryrefslogtreecommitdiff
path: root/builtin-rev-list.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-04-04 06:01:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-04-13 02:41:29 (GMT)
commit72276a3ecbe6353b83ab37e0ce96cc21c94cf6ee (patch)
tree87d9c431a6565ebb4682069d74ee675fc981f357 /builtin-rev-list.c
parentf35f5603f4f07c939754743b2a6cf61bb3a4694e (diff)
downloadgit-72276a3ecbe6353b83ab37e0ce96cc21c94cf6ee.zip
git-72276a3ecbe6353b83ab37e0ce96cc21c94cf6ee.tar.gz
git-72276a3ecbe6353b83ab37e0ce96cc21c94cf6ee.tar.bz2
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>
Diffstat (limited to 'builtin-rev-list.c')
-rw-r--r--builtin-rev-list.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index edc0bd3..9da2f76 100644
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
@@ -36,6 +36,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"
@@ -84,6 +85,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(' ');