Anonymous committed a3347b9

fmt-merge-message: add empty line between tag and signature verification

When adding the information from a tag, put an empty line between the
message of the tag and the commented-out signature verification

At least for the kernel workflow, I often end up re-formatting the message
that people send me in the tag data. In that situation, putting the tag
message and the tag signature verification back-to-back then means that
normal editor "reflow parapgraph" command will get confused and think that
the signature is a continuation of the last message paragraph.

So I always end up having to first add an empty line, and then go back and
reflow the last paragraph. Let's just do it in git directly.

The extra vertical space also makes the verification visually stand out
more from the user-supplied message, so it looks a bit more readable to me
too, but that may be just an odd personal preference.

Signed-off-by: Linus Torvalds <>
Signed-off-by: Junio C Hamano <>

Comments (0)

Files changed (1)


 		strbuf_add(tagbuf, tag_body, buf + len - tag_body);
-	strbuf_add_lines(tagbuf, "# ", sig->buf, sig->len);
+	if (sig->len) {
+		strbuf_addch(tagbuf, '\n');
+		strbuf_add_lines(tagbuf, "# ", sig->buf, sig->len);
+	}
 static void fmt_merge_msg_sigs(struct strbuf *out)
 		rev.ignore_merges = 1; = 1;
-		if (suffixcmp(out->buf, "\n"))
-			strbuf_addch(out, '\n');
+		strbuf_complete_line(out);
 		for (i = 0; i <; i++)