@matheusbsbs / matheus-bagliano / commits / 903b45fe18
Fork 0

git-log -g --pretty=oneline should display the reflog message

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>

Nicolas Pitre committed Jan 27, 2007 at 22:40 UTC 903b45fe1808f72e712a118bf115b9dc07d02420
2 files changed +7 -2
log-tree.c
+6 -1
@@ -224,9 +224,14 @@ void show_log(struct rev_info *opt, const char *sep)
224 printf("%s",
225 diff_get_color(opt->diffopt.color_diff, DIFF_RESET));
226 putchar(opt->commit_format == CMIT_FMT_ONELINE ? ' ' : '\n');
227 - if (opt->reflog_info)
227 + if (opt->reflog_info) {
228 show_reflog_message(opt->reflog_info,
229 opt->commit_format == CMIT_FMT_ONELINE);;
230 + if (opt->commit_format == CMIT_FMT_ONELINE) {
231 + printf("%s", sep);
232 + return;
233 + }
234 + }
235 }
236
237 /*
reflog-walk.c
+1 -1
@@ -233,7 +233,7 @@ void show_reflog_message(struct reflog_walk_info* info, int oneline)
233 else
234 printf("%d", commit_reflog->reflogs->nr
235 - 2 - commit_reflog->recno);
236 - printf("}: ");
236 + printf("}: %s", info->message);
237 }
238 else {
239 printf("Reflog: %s@{", commit_reflog->reflogs->ref);