提交 72276a3e 编写于 作者: J Junio C Hamano

rev-list --children

Just like --parents option shows the parents of commits, this shows the
children of commits.
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 f35f5603
......@@ -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(' ');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册