summaryrefslogtreecommitdiff
path: root/log-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-10-18 21:59:12 -0700
committerJunio C Hamano <gitster@pobox.com>2011-10-18 21:59:12 -0700
commitaadf863de8e47e74f5b53e882a83f2098da1a36f (patch)
tree77d0f58b42a7aab1830424ad5c77463c63a9b1cb /log-tree.c
parent43a3b0284f97c9beb31ba3d53ffb8a191314b1f4 (diff)
parent91b849b273a7f3786d8cac569352aaa8bca7b46c (diff)
downloadgit-aadf863de8e47e74f5b53e882a83f2098da1a36f.tar.gz
Merge branch 'js/log-show-children'
* js/log-show-children: log --children
Diffstat (limited to 'log-tree.c')
-rw-r--r--log-tree.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/log-tree.c b/log-tree.c
index 24c295ea1d..e7694a3a4c 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -165,6 +165,14 @@ static void show_parents(struct commit *commit, int abbrev)
}
}
+static void show_children(struct rev_info *opt, struct commit *commit, int abbrev)
+{
+ struct commit_list *p = lookup_decoration(&opt->children, &commit->object);
+ for ( ; p; p = p->next) {
+ printf(" %s", find_unique_abbrev(p->item->object.sha1, abbrev));
+ }
+}
+
void show_decorations(struct rev_info *opt, struct commit *commit)
{
const char *prefix;
@@ -414,6 +422,8 @@ void show_log(struct rev_info *opt)
fputs(find_unique_abbrev(commit->object.sha1, abbrev_commit), stdout);
if (opt->print_parents)
show_parents(commit, abbrev_commit);
+ if (opt->children.name)
+ show_children(opt, commit, abbrev_commit);
show_decorations(opt, commit);
if (opt->graph && !graph_is_commit_finished(opt->graph)) {
putchar('\n');
@@ -473,6 +483,8 @@ void show_log(struct rev_info *opt)
stdout);
if (opt->print_parents)
show_parents(commit, abbrev_commit);
+ if (opt->children.name)
+ show_children(opt, commit, abbrev_commit);
if (parent)
printf(" (from %s)",
find_unique_abbrev(parent->object.sha1,