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

Re: git imap-send converting my patches to CRLF line endings?

From
BCBrandon Casey <brandon.casey.ctr@nrlssc.navy.mil>
Date
Jun 17, 2011, 14:47 UTC
Message-ID
<QMrPJrj9ztlKRRk907LM0hozdFOSLjShMt2uDhbAk6DGxE1OSBFMkg@cipher.nrlssc.navy.mil>
In-Reply-To
<20110617141450.GA12114@sigill.intra.peff.net>
On 06/17/2011 09:14 AM, Jeff King wrote:
Show 8 quoted lines
> On Fri, Jun 17, 2011 at 03:35:04PM +0200, Michael Mc Donnell wrote:
> 
>> I'm using git imap-send to send patches to wine-patches, and it seems
>> like it converts all my patches to have CRLF line endings?
> 
> The canonical line ending for mail is CRLF. So yes, it will convert your
> patch to CRLF for storage. But anything pulling it out of the IMAP
> folder should convert it back to native line endings.

Not always. Modern thunderbird (3.1.10, is that modern? I haven't checked), saves mail using CRLF. I don't have access to gmail at the moment, but I'm pretty sure gmail does the same thing, i.e. when you select "view original", and then use your browser to "save as...".

mailsplit was modified to strip CRLF when splitting mail here:
  c2ca1d7 Allow mailsplit (and hence git-am) to handle mails with CRLF line-endings
which should have first appeared in git v1.6.5.
Show 8 quoted lines
>> I can see it when I download the patch from the Gmail drafts folder.
>> Git complains about white space when I apply the downloaded patch. It
>> works fine if I just use git to create the patch and then apply it on
>> a new branch. Is it git imap-send or just Gmail that's the problem?
> 
> How do you download and apply the patch exactly? If you are speaking
> imap to gmail, generally the client would strip out the CR's from the
> mail.

Michael, how are you applying the "email"? Are you using 'git am'? or possibly are you trying to use 'git apply'? You need to use 'git am'.

Also, as I mentioned above, you should be using git more recent than v1.6.5 so that you have a mailsplit that will strip out the CRLF line endings.

-Brandon
Previous: Michael Mc DonnellNext: Jeff King
Message 9 of 10 in “git imap-send converting my patches to CRLF line endings?”
  1. Michael Mc DonnellJun 17, 2011
  2. Jeff KingJun 17, 2011
  3. Michael Mc DonnellJun 17, 2011
  4. Brandon CaseyJun 17, 2011
  5. Brandon CaseyJun 17, 2011
  6. Jeff KingJun 17, 2011
  7. Brandon CaseyJun 17, 2011
  8. Michael Mc DonnellJun 20, 2011
  9. Brandon CaseyJun 17, 2011
  10. Jeff KingJun 17, 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.