Skip to content

Commit

Permalink
log: print log entry terminator even if the message is empty
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Adam Simpkins authored and Junio C Hamano committed May 3, 2008
1 parent 0286565 commit 9b58bfe
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions log-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,10 @@ void show_log(struct rev_info *opt)
if (opt->show_log_size)
printf("log size %i\n", (int)msgbuf.len);

if (msgbuf.len) {
if (msgbuf.len)
fwrite(msgbuf.buf, sizeof(char), msgbuf.len, stdout);
if (opt->use_terminator)
putchar('\n');
}
if (opt->use_terminator)
putchar('\n');
strbuf_release(&msgbuf);
}

Expand Down

0 comments on commit 9b58bfe

Please sign in to comment.