From ca4ca9ed069c8ce13e1a38e79fbaea849754de94 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Fri, 17 Jul 2009 19:18:34 -0400 Subject: [PATCH] show: suppress extra newline when showing annotated tag When showing a tag, our header parsing finishes with the offset pointing to the newline separating the tag header from the tag body. This means that the printed body will always start with a newline. However, we also add an extra newline when printing the tagger information. This leads to an ugly double-newline: $ git show v1.6.3 tag v1.6.3 Tagger: Junio C Hamano Date: Wed May 6 18:16:47 2009 -0700 GIT 1.6.3 -----BEGIN PGP SIGNATURE----- ... This patch removes the extra newline from the end of the tagger headers. This is a better solution than suppressing the separator newline, because it retains the behavior for tags which have no tagger. E.g., "git show v0.99" will continue to look like: $ git show v0.99 tag v0.99 Test-release for wider distribution. ... Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- builtin-log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin-log.c b/builtin-log.c index 0c2fa0ae2d..b05796d7bc 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -257,7 +257,7 @@ static void show_tagger(char *buf, int len, struct rev_info *rev) pp_user_info("Tagger", rev->commit_format, &out, buf, rev->date_mode, git_log_output_encoding ? git_log_output_encoding: git_commit_encoding); - printf("%s\n", out.buf); + printf("%s", out.buf); strbuf_release(&out); } -- 2.11.4.GIT