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, 15:08 UTC
Message-ID
<Svak9atXpisIKwqaYKGMzry3LEHEDPnWLLqFpfgP7IOuAVUdRy8brA@cipher.nrlssc.navy.mil>
In-Reply-To
<BANLkTin1DAv0pZmZCcrtDyjrUD-ukO6MNQ@mail.gmail.com>
On 06/17/2011 09:45 AM, Michael Mc Donnell wrote:
> On Fri, Jun 17, 2011 at 4:14 PM, Jeff King <peff@peff.net> wrote:
>> On Fri, Jun 17, 2011 at 03:35:04PM +0200, Michael Mc Donnell wrote:
Show 13 quoted lines
>> 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.
> 
> I'm just downloading it with Chrome.
> 
> Steps to reproduce:
> 1. Upload patch via:
> $ git format-patch --stdout --keep-subject --attach origin | git imap-send
> 2. Open Gmail in Chrome.
> 3. Open email in drafts folder.
> 4. Click attachment download link
> 5. Apply patch on a fresh branch with git apply.
                                        ^^^^^^^^^

Ok, I suspected that. The thing that you download from your gmail drafts folder is an email, not a patch. It may contain many inline patches though. You need to use 'git am' which will extract the patches from the email and apply them.

A word of caution about using imap and gmail:

Unless something has changed recently, and I don't think it has, if you _send_ the email using gmail's web interface, it will add newlines at the 72nd character, and corrupt your patch. So, even though you uploaded the patch using 'git imap-send', you still have to select it from your drafts folder and click "send" from gmail's web interface. So, gmail's imap interface is pretty useless for sending patches. You should be able to use 'git send-email' and configure gmail as your smtp server though.

-Brandon
Previous: Michael Mc DonnellNext: Brandon Casey
Message 4 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.