git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v5] format-patch --signature-file <file>

From
Jeff King <peff@peff.net>
Date
May 20, 2014, 18:24 UTC
Message-ID
<20140520182443.GA30533@sigill.intra.peff.net>
In-Reply-To
<xmqq61l01gmw.fsf@gitster.dls.corp.google.com>
On Tue, May 20, 2014 at 10:53:11AM -0700, Junio C Hamano wrote:
Show 13 quoted lines
> 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.

If it were just "--signature", I'd agree. After all, nobody is even complaining. But this is also in preparation for --signature-file. Should the user create a file without a trailing newline?

We can special-case --signature-file to strip the final newline from the read file, but it seems friendlier to handle it at the printing stage (and then we handle the unlikely but possible --signature as above for free). I don't think it would adversely impact any real-world case, because somebody would have to:

  1. already be including an extra trailing newline
  2. really _want_ three newlines at the end
> 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.

Yeah. I think it is probably extraneous and would not hurt to remove. But it may not be worth worrying about (it's really the _two_ lines caused by the unconditional newline above that bugs me).

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 15 in “format-patch --signature-file <file>”
  1. format-patch --signature-file <file>Jeremiah Mahler, May 20, 2014
  2. format-patch --signature-file <file>Jeremiah Mahler, May 20, 2014
  3. Jeff KingMay 20, 2014
  4. Junio C HamanoMay 20, 2014
  5. Jeff KingMay 20, 2014
  6. Junio C HamanoMay 20, 2014
  7. Jeff KingMay 21, 2014
  8. Jeremiah MahlerMay 21, 2014
  9. Jeff KingMay 21, 2014
  10. Junio C HamanoMay 21, 2014
  11. Jeff KingMay 21, 2014
  12. Junio C HamanoMay 21, 2014
  13. Jeff KingMay 21, 2014
  14. Jeremiah MahlerMay 21, 2014
  15. Jeremiah MahlerMay 21, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.