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

Re: am fails to apply patches for files with CRLF lineendings

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
Dec 15, 2009, 01:25 UTC
Message-ID
<20091215012514.GB1317@atjola.homenet>
In-Reply-To
<ee63ef30912141650ie05baf4kab8505adf160c62e@mail.gmail.com>
On 2009.12.14 18:50:44 -0600, Brandon Casey wrote:
> I think it is more correct to say that the line termination in an email is
> ambiguous.  CRLF does not necessarily mean that the original had CRLF line
> termination if RFC-2822 is followed explicitly.

Right. And checking, after sending a patch containing CRs with mutt, it lost those CRs. Even the local copy saved directly by mutt, which didn't leave my box, lacks the CRs. So it seems basically impossible to send patches to CRLF files inline.

RFC-822 still allowed bare CRs/LFs :-/

So the commit didn't break with anything mails conforming to RFC-2822, those won't work for files with CR being patch. But it still breaks the the raw format-patch generated patches, so even attaching them to the actual email as a workaround won't do.

That makes a "use the first line to decide whether or not to strip CRs" approach look like a good idea. Real mails are broken anyway, and the format-patch output has LF on the first line, so mailsplit wouldn't mess it up... Unless git on windows produces CRLF format-patch output...

Björn
Previous: Jason KingNext: Andreas Schwab
Message 8 of 18 in “am fails to apply patches for files with CRLF lineendings”
  1. Björn SteinbrinkDec 14, 2009
  2. Junio C HamanoDec 14, 2009
  3. Junio C HamanoDec 14, 2009
  4. Brandon CaseyDec 14, 2009
  5. Junio C HamanoDec 14, 2009
  6. Björn SteinbrinkDec 14, 2009
  7. Jason KingDec 14, 2009
  8. Björn SteinbrinkDec 15, 2009
  9. Andreas SchwabDec 15, 2009
  10. Andreas SchwabDec 16, 2009
  11. Fwd: am fails to apply patches for files with CRLF lineendingsBrandon Casey, Dec 15, 2009
  12. Sverre RabbelierDec 15, 2009
  13. Brandon CaseyDec 15, 2009
  14. Andreas SchwabDec 15, 2009
  15. Junio C HamanoDec 15, 2009
  16. Brandon CaseyDec 15, 2009
  17. Brandon CaseyJan 5, 2010
  18. Jason KingFeb 13, 2010

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.