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
Junio C Hamano <gitster@pobox.com>
Date
Dec 15, 2009, 02:12 UTC
Message-ID
<7vfx7d7zpp.fsf@alter.siamese.dyndns.org>
In-Reply-To
<ee63ef30912141650ie05baf4kab8505adf160c62e@mail.gmail.com>
Brandon Casey <drafnel@gmail.com> writes:
Show 7 quoted lines
>> It actually is the norm to use LF as the line terminator in the body text
>> in saved messages (and trailing CR as a true part of the payload), and
>> "am" traditionally used that definition.  It is meant to read from "mbox"
>> format to begin with.
>
> But isn't each email in the mbox file supposed to be RFC-2822 formatted
> anyway?

If you are talking about the same "mbox" I was talking about, which is what I see when I peek "/var/mail/junio", then the answer is no. Their lines are terminated with a LF, and if you insert CR at the end of the line it would appear as true payload. DOSsy boxes can have C:\mail\user or whatever that has DOS text, of course, so there is no "supposed to be".

Having said that, it does not matter an iota in the real world if somebody declares on _this list_ that it a bug that Thunderbird spits out CRLF text in response to "Save As..." on platforms where LF is the natural line terminator [*1*]. Whether it is a bug or not, we still need to help people with such a program without breaking others.

I saw "peeking the line ending of the first line" as suggested as a solution, and my gut feeling, without thinking too much about it, is that it is likely to be the right thing to do, especially if we do both the check and the necessary conversion in either mailinfo or even in mailsplit.

[Footnote]

*1* It is a different matter if it was done on _their_ mailing list, and it would even be better if such a discussion on _their_ mailing list resulted in a fix over there.

Previous: Andreas SchwabNext: Brandon Casey
Message 15 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.