[PATCH 2/2] log: print log entry terminator even if the message is empty

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux