Skip to content

Commit aadf863

Browse files
committed
Merge branch 'js/log-show-children'
* js/log-show-children: log --children
2 parents 43a3b02 + 91b849b commit aadf863

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

log-tree.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,14 @@ static void show_parents(struct commit *commit, int abbrev)
165165
}
166166
}
167167

168+
static void show_children(struct rev_info *opt, struct commit *commit, int abbrev)
169+
{
170+
struct commit_list *p = lookup_decoration(&opt->children, &commit->object);
171+
for ( ; p; p = p->next) {
172+
printf(" %s", find_unique_abbrev(p->item->object.sha1, abbrev));
173+
}
174+
}
175+
168176
void show_decorations(struct rev_info *opt, struct commit *commit)
169177
{
170178
const char *prefix;
@@ -414,6 +422,8 @@ void show_log(struct rev_info *opt)
414422
fputs(find_unique_abbrev(commit->object.sha1, abbrev_commit), stdout);
415423
if (opt->print_parents)
416424
show_parents(commit, abbrev_commit);
425+
if (opt->children.name)
426+
show_children(opt, commit, abbrev_commit);
417427
show_decorations(opt, commit);
418428
if (opt->graph && !graph_is_commit_finished(opt->graph)) {
419429
putchar('\n');
@@ -473,6 +483,8 @@ void show_log(struct rev_info *opt)
473483
stdout);
474484
if (opt->print_parents)
475485
show_parents(commit, abbrev_commit);
486+
if (opt->children.name)
487+
show_children(opt, commit, abbrev_commit);
476488
if (parent)
477489
printf(" (from %s)",
478490
find_unique_abbrev(parent->object.sha1,

0 commit comments

Comments
 (0)