git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adam Simpkins <adam@adamsimpkins.net>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
	Adam Simpkins <adam@adamsimpkins.net>
Subject: [PATCH 2/2] log: print log entry terminator even if the message is empty
Date: Tue, 29 Apr 2008 01:33:00 -0700	[thread overview]
Message-ID: <1209457980-19677-2-git-send-email-adam@adamsimpkins.net> (raw)
In-Reply-To: <1209457980-19677-1-git-send-email-adam@adamsimpkins.net>

This eliminates a special case in the show_log() function, to help
simplify the terminator semantics.  Now show_log() always prints a
newline after the log entry when use_terminator is set, even if the log
message is empty.

This change should only affect the --pretty=tformat output, since that
was the only way to trigger this special case.

Signed-off-by: Adam Simpkins <adam@adamsimpkins.net>
---
 log-tree.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/log-tree.c b/log-tree.c
index 4c7d7ef..74b79b5 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -307,11 +307,9 @@ void show_log(struct rev_info *opt)
 	if (opt->show_log_size)
 		printf("log size %i\n", (int)msgbuf.len);
 
-	if (msgbuf.len) {
-		fwrite(msgbuf.buf, sizeof(char), msgbuf.len, stdout);
-		if (opt->use_terminator)
-			putchar('\n');
-	}
+	fwrite(msgbuf.buf, sizeof(char), msgbuf.len, stdout);
+	if (opt->use_terminator)
+		putchar('\n');
 	strbuf_release(&msgbuf);
 }
 
-- 
1.5.3.6

      reply	other threads:[~2008-04-29  8:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-29  8:32 [PATCH 1/2] Remove dead code: show_log() sep argument and diff_options.msg_sep Adam Simpkins
2008-04-29  8:33 ` Adam Simpkins [this message]

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=1209457980-19677-2-git-send-email-adam@adamsimpkins.net \
    --to=adam@adamsimpkins.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).