summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/rev-list-options.txt4
-rw-r--r--builtin-rev-list.c10
2 files changed, 14 insertions, 0 deletions
diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index 2648a55085..e5823950e2 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -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.
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index edc0bd35bb..9da2f76375 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(' ');