From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Jeremiah Mahler <jmmahler@gmail.com>, git@vger.kernel.org
Subject: Re: [PATCH v5] format-patch --signature-file <file>
Date: Tue, 20 May 2014 10:53:11 -0700 [thread overview]
Message-ID: <xmqq61l01gmw.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20140520082740.GB27590@sigill.intra.peff.net> (Jeff King's message of "Tue, 20 May 2014 04:27:40 -0400")
Jeff King <peff@peff.net> writes:
> But one could easily specify a longer, multi-line signature,
> like:
>
> git format-patch --signature='
> this is my long signature
>
> it has multiple lines
> ' ...
>
> We should notice that it already has its own trailing
> newline, and suppress one of ours.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> In the example above, there's also a newline before the signature
> starts. Should we suppress the first one, too?
>
> Also, I'm not clear on the purpose of the extra trailing line in the
> first place. Emails now end with (">" added to show blanks):
>
> > --
> > 2.0.0-rc3...
> >
>
> Is there are a reason for that final blank line?
I actually think these "supress extra LFs" trying to be overly smart
and inviting unnecessary surprises. Unlike log messages people type
(in which we do squash runs of blank lines and other prettifying),
mail-signature string is not something people keep typing, and it
would be better to keep it simple and consistent, i.e. we can
declare that the users who use non-default mail-signature can and
should learn to:
--signature='this is the first line of my long sig
with a blank line and then it ends here'
and be done with it, I think.
The trailing blank after the mail-signature is a different issue. I
think it is safe to remove it and I also think the result may look
better, but at the same time, it is very close to the "if we were
writing format-patch today, then we would..." category, I would say.
> builtin/log.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/log.c b/builtin/log.c
> index 39e8836..5acc048 100644
> --- a/builtin/log.c
> +++ b/builtin/log.c
> @@ -844,8 +844,13 @@ static void gen_message_id(struct rev_info *info, char *base)
>
> static void print_signature(void)
> {
> - if (signature && *signature)
> - printf("-- \n%s\n\n", signature);
> + if (!signature || !*signature)
> + return;
> +
> + printf("-- \n%s", signature);
> + if (signature[strlen(signature)-1] != '\n')
> + putchar('\n');
> + putchar('\n');
> }
>
> static void add_branch_description(struct strbuf *buf, const char *branch_name)
next prev parent reply other threads:[~2014-05-20 17:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-20 8:00 [PATCH v5] format-patch --signature-file <file> Jeremiah Mahler
2014-05-20 8:00 ` Jeremiah Mahler
2014-05-20 8:27 ` Jeff King
2014-05-20 17:53 ` Junio C Hamano [this message]
2014-05-20 18:24 ` Jeff King
2014-05-20 18:46 ` Junio C Hamano
2014-05-21 16:42 ` Jeff King
2014-05-21 16:55 ` Jeremiah Mahler
2014-05-21 17:00 ` Jeff King
2014-05-21 17:37 ` Junio C Hamano
2014-05-21 17:59 ` Jeff King
2014-05-21 18:26 ` Junio C Hamano
2014-05-21 20:47 ` Jeff King
2014-05-21 21:14 ` Jeremiah Mahler
2014-05-21 0:42 ` Jeremiah Mahler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq61l01gmw.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jmmahler@gmail.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.