git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Pitre <nico@cam.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: [PATCH] git-log -g --pretty=oneline should display the reflog message
Date: Sat, 27 Jan 2007 22:40:36 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0701272235190.3021@xanadu.home> (raw)
In-Reply-To: <Pine.LNX.4.64.0701272049480.3021@xanadu.home>

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>

---

On Sat, 27 Jan 2007, Nicolas Pitre wrote:

> The --pretty=oneline output when using -g should probably display the 
> reflog message instead of the commit message as well.

And this patch does just that.

diff --git a/log-tree.c b/log-tree.c
index c0fa096..d8ca36b 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -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;
+			}
+		}
 	}
 
 	/*
diff --git a/reflog-walk.c b/reflog-walk.c
index 8e2cd2f..8262160 100644
--- a/reflog-walk.c
+++ b/reflog-walk.c
@@ -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);

  reply	other threads:[~2007-01-28  3:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-27  8:29 What's cooking in git.git (topics) Junio C Hamano
2007-01-27 19:23 ` Nicolas Pitre
2007-01-27 22:00   ` Junio C Hamano
2007-01-28  2:51     ` Nicolas Pitre
2007-01-28  3:40       ` Nicolas Pitre [this message]
2007-01-28  8:29       ` Junio C Hamano
2007-01-29  4:41       ` Nicolas Pitre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0701272235190.3021@xanadu.home \
    --to=nico@cam.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).