Skip to content

Commit

Permalink
Merge branch 'js/log-show-children'
Browse files Browse the repository at this point in the history
* js/log-show-children:
  log --children
  • Loading branch information
Junio C Hamano committed Oct 19, 2011
2 parents 43a3b02 + 91b849b commit aadf863
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions log-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit aadf863

Please sign in to comment.