Skip to content

Commit ca4ca9e

Browse files
peffgitster
authored andcommitted
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 <[email protected]> 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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4525e8e commit ca4ca9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin-log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static void show_tagger(char *buf, int len, struct rev_info *rev)
257257
pp_user_info("Tagger", rev->commit_format, &out, buf, rev->date_mode,
258258
git_log_output_encoding ?
259259
git_log_output_encoding: git_commit_encoding);
260-
printf("%s\n", out.buf);
260+
printf("%s", out.buf);
261261
strbuf_release(&out);
262262
}
263263

0 commit comments

Comments
 (0)