1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-29 06:16:11 +02:00

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>
This commit is contained in:
Junio C Hamano 2008-04-03 23:01:47 -07:00
parent f35f5603f4
commit 72276a3ecb
2 changed files with 14 additions and 0 deletions

View File

@ -42,6 +42,10 @@ format, often found in E-mail messages.
Print the parents of the commit.
--children::
Print the children of the commit.
--timestamp::
Print the raw commit timestamp.

View File

@ -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(' ');