mirror of
https://github.com/git/git
synced 2024-08-28 20:20:07 +00: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:
parent
f35f5603f4
commit
72276a3ecb
|
@ -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.
|
||||
|
||||
|
|
|
@ -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(' ');
|
||||
|
|
Loading…
Reference in a new issue