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

Re: git am and CRLF files

From
Nanako Shiraishi <nanako3@lavabit.com>
Date
Nov 16, 2009, 10:50 UTC
Message-ID
<20091116195036.6117@nanako3.lavabit.com>
In-Reply-To
<4B01004A.8060600@atlas-elektronik.com>
Quoting Stefan Naewe <stefan.naewe@atlas-elektronik.com>
Show 11 quoted lines
>> A repository with some UNIX (LF) and some Windows (CRLF) files.
>> (and no: I will not change the files. My editors handle CRLF and LF correctly)
>> 
>> My problem:
>> 
>> 'git am' can't handle changes in CRLF files because the patch
>> gets converted (by git mailsplit) to contain only LF.
>
>> Stefan
>
> Does anyone have any comment on this ?
This was done very much on purpose.

The "am" command is meant to handle e-mailed patches, and traditionally mails are known to clobber carriage returns.

See commit c2ca1d79dbd54b06a05e5d14a897699e59dc9f9f
    Allow mailsplit (and hence git-am) to handle mails with CRLF line-endings
    
    It is not that uncommon to have mails with DOS line-ending, notably
    Thunderbird and web mailers like Gmail (when saving what they call
    "original" message).  So modify mailsplit to convert CRLF line-endings to
    just LF.
-- 
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
Previous: Stefan NaeweNext: Stefan Naewe
Message 3 of 7 in “git am and CRLF files”
  1. Stefan NaeweNov 13, 2009
  2. Stefan NaeweNov 16, 2009
  3. Nanako ShiraishiNov 16, 2009
  4. Stefan NaeweNov 16, 2009
  5. Erik Faye-LundNov 16, 2009
  6. Daniele SegatoNov 30, 2009
  7. Ismael LucenoNov 30, 2009

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.