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

Re: [PATCH] generate a valid rfc2047 mail header for multi-line subject.

From
Jeff King <peff@peff.net>
Date
Feb 23, 2011, 09:48 UTC
Message-ID
<20110223094844.GA9205@sigill.intra.peff.net>
In-Reply-To
<20110223080854.GB2724@sigill.intra.peff.net>
On Wed, Feb 23, 2011 at 03:08:54AM -0500, Jeff King wrote:
Show 12 quoted lines
> Yeah, I think the best path forward is:
> 
>   1. Stop feeding "pre-folded" subject lines to the email formatter.
>      Give it the regular subject line with no newlines.
> 
>   2. rfc2047 encoding should encode a literal newline. Which should
>      generally never happen, but is probably the most sane thing to do
>      if it does.
> 
>   3. rfc2047 should fold all lines at some sane length. As it is now, we
>      may sometimes generate long lines in headers (though in practice, I
>      doubt this is much of a problem).

So here is a series that does this. It still doesn't preserve subject newlines in "format-patch | am", but I don't think that was ever a goal of the code. If we want to add it as an optional feature on top (maybe as part of "-k"?), it should be easy to do (since the rfc2047 encoding will now preserve embedded newlines).

  [1/3]: strbuf: add fixed-length version of add_wrapped_text
  [2/3]: format-patch: wrap long header lines
  [3/3]: format-patch: rfc2047-encode newlines in headers
-Peff
Previous: Jeff KingNext: Jeff King
Message 4 of 15 in “generate a valid rfc2047 mail header for multi-line subject.”
  1. generate a valid rfc2047 mail header for multi-line subject.xzer, Feb 14, 2011
  2. Junio C HamanoFeb 22, 2011
  3. Jeff KingFeb 23, 2011
  4. Jeff KingFeb 23, 2011
  5. 1/3 strbuf: add fixed-length version of add_wrapped_textJeff King, Feb 23, 2011
  6. 2/3 format-patch: wrap long header linesJeff King, Feb 23, 2011
  7. 3/3 format-patch: rfc2047-encode newlines in headersJeff King, Feb 23, 2011
  8. Junio C HamanoFeb 23, 2011
  9. Jeff KingFeb 24, 2011
  10. xzerFeb 23, 2011
  11. Jeff KingFeb 23, 2011
  12. Junio C HamanoFeb 23, 2011
  13. Jeff KingFeb 24, 2011
  14. xzerFeb 23, 2011
  15. Junio C HamanoFeb 23, 2011

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.