format-patch: make zero-length subject prefixes prettier
authorJeff King <peff@peff.net>
Mon, 30 May 2011 14:19:05 +0000 (10:19 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 30 May 2011 18:18:59 +0000 (11:18 -0700)
If you give a zero-length subject prefix to format-patch
(e.g., "format-patch --subject-prefix="), we will print the
ugly:

Subject: [ 1/2] your subject here

because we always insert a space between the prefix and
numbering. Requiring the user to provide the space in their
prefix would be more flexible, but would break existing
usage. This patch provides a DWIM and suppresses the space
for zero-length prefixes, under the assumption that nobody
actually wants "[ 1/2]".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found