Browse Source

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>
maint
Junio C Hamano 17 years ago
parent
commit
72276a3ecb
  1. 4
      Documentation/rev-list-options.txt
  2. 10
      builtin-rev-list.c

4
Documentation/rev-list-options.txt

@ -42,6 +42,10 @@ format, often found in E-mail messages. @@ -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.


10
builtin-rev-list.c

@ -36,6 +36,7 @@ static const char rev_list_usage[] = @@ -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) @@ -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…
Cancel
Save