Skip to content

Commit

Permalink
git-log -g --pretty=oneline should display the reflog message
Browse files Browse the repository at this point in the history
In the context of reflog output the reflog message is more useful than
the commit message's first line.  When relevant the reflog message
will contain that line anyway.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Nicolas Pitre authored and Junio C Hamano committed Jan 28, 2007
1 parent 16507fc commit 903b45f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion log-tree.c
Expand Up @@ -224,9 +224,14 @@ void show_log(struct rev_info *opt, const char *sep)
printf("%s",
diff_get_color(opt->diffopt.color_diff, DIFF_RESET));
putchar(opt->commit_format == CMIT_FMT_ONELINE ? ' ' : '\n');
if (opt->reflog_info)
if (opt->reflog_info) {
show_reflog_message(opt->reflog_info,
opt->commit_format == CMIT_FMT_ONELINE);;
if (opt->commit_format == CMIT_FMT_ONELINE) {
printf("%s", sep);
return;
}
}
}

/*
Expand Down
2 changes: 1 addition & 1 deletion reflog-walk.c
Expand Up @@ -233,7 +233,7 @@ void show_reflog_message(struct reflog_walk_info* info, int oneline)
else
printf("%d", commit_reflog->reflogs->nr
- 2 - commit_reflog->recno);
printf("}: ");
printf("}: %s", info->message);
}
else {
printf("Reflog: %s@{", commit_reflog->reflogs->ref);
Expand Down

0 comments on commit 903b45f

Please sign in to comment.