# Gmail and unwanted line-wrapping

8 messages from 2010-02-06 to 2010-02-08. Participants: Aaron Crane, Sverre Rabbelier, Jacob Helwig, David Aguilar, Jay Soffian, Erik Faye-Lund.
Thread: https://gitlist.dev/t/22550

## Aaron Crane, 2010-02-06 20:29

Subject: Gmail and unwanted line-wrapping
Message-ID: <bc341e101002061229t7a1525c2w2d5a8e221124b3c2@mail.gmail.com>
URL: https://gitlist.dev/e/bc341e101002061229t7a1525c2w2d5a8e221124b3c2%40mail.gmail.com

```
Documentation/SubmittingPatches says this about dealing with Gmail's
propensity for breaking your email:

> GMail does not appear to have any way to turn off line wrapping in the web
> interface, so this will mangle any emails that you send.  You can however
> use any IMAP email client to connect to the google imap server, and forward
> the emails through that.  Just make sure to disable line wrapping in that
> email client.  Alternatively, use "git send-email" instead.
>
> Submitting properly formatted patches via Gmail is simple now that
> IMAP support is available. First, edit your ~/.gitconfig to specify your
> account settings:
<snip>
> Next, ensure that your Gmail settings are correct. In "Settings" the
> "Use Unicode (UTF-8) encoding for outgoing messages" should be checked.
>
> Once your commits are ready to send to the mailing list, run the following
> command to send the patch emails to your Gmail Drafts folder.
>
>         $ git format-patch -M --stdout origin/master | git imap-send
>
> Go to your Gmail account, open the Drafts folder, find the patch email, fill
> in the To: and CC: fields and send away!

However, the advice beginning "Submitting properly formatted patches
via Gmail is simple now" doesn't match my experience.  Following those
guidelines seemed to work, but my patch was line-wrapped anyway.

It seems I'm not the only person who's observed this:
http://article.gmane.org/gmane.comp.version-control.git/133020

Can anyone think of anything I might have done wrong here?  If not,
I'm inclined to suggest dropping all of that advice.  That's not
ideal, because it leaves Gmail users with no obvious way to submit
well-formatted patches to the list; but it's better than suggesting
something which apparently doesn't work.

-- 
Aaron Crane ** http://aaroncrane.co.uk/

```

## Sverre Rabbelier, 2010-02-06 20:47

Subject: Re: Gmail and unwanted line-wrapping
Message-ID: <fabb9a1e1002061247k7a8fba5at4c687faac0dcabb8@mail.gmail.com>
URL: https://gitlist.dev/e/fabb9a1e1002061247k7a8fba5at4c687faac0dcabb8%40mail.gmail.com
In-Reply-To: <bc341e101002061229t7a1525c2w2d5a8e221124b3c2@mail.gmail.com>

```
Heya,

On Sat, Feb 6, 2010 at 21:29, Aaron Crane <git@aaroncrane.co.uk> wrote:
> Can anyone think of anything I might have done wrong here?  If not,
> I'm inclined to suggest dropping all of that advice.  That's not
> ideal, because it leaves Gmail users with no obvious way to submit
> well-formatted patches to the list; but it's better than suggesting
> something which apparently doesn't work.

I'm using git send-email with this configuration:
[sendemail]
  smtencryption = tls
  smtpserver = smtp.gmai.com
  smtpuser = srabbelier@gmail.com
  smptserverport = 587

It'll ask you for your password when you're sending the emails. Like so:

$ git format-patch --no-color -C -M origin/master..topic-branch -o outgoing/
$ git send-email --compose outgoing/00*

Of course you should substitute specific things as appropriate, I
doubt you'll want to be sending your patches pretending to be me :P.

-- 
Cheers,

Sverre Rabbelier

```

## Jacob Helwig, 2010-02-06 20:49

Subject: Re: Gmail and unwanted line-wrapping
Message-ID: <20100206204917.GA30894@vfb-9.home>
URL: https://gitlist.dev/e/20100206204917.GA30894%40vfb-9.home
In-Reply-To: <bc341e101002061229t7a1525c2w2d5a8e221124b3c2@mail.gmail.com>

```
On 20:29 Sat 06 Feb     , Aaron Crane wrote:
> Documentation/SubmittingPatches says this about dealing with Gmail's
> propensity for breaking your email:
> 
> > GMail does not appear to have any way to turn off line wrapping in the web
> > interface, so this will mangle any emails that you send.  You can however
> > use any IMAP email client to connect to the google imap server, and forward
> > the emails through that.  Just make sure to disable line wrapping in that
> > email client.  Alternatively, use "git send-email" instead.
> >
> > Submitting properly formatted patches via Gmail is simple now that
> > IMAP support is available. First, edit your ~/.gitconfig to specify your
> > account settings:
> <snip>
> > Next, ensure that your Gmail settings are correct. In "Settings" the
> > "Use Unicode (UTF-8) encoding for outgoing messages" should be checked.
> >
> > Once your commits are ready to send to the mailing list, run the following
> > command to send the patch emails to your Gmail Drafts folder.
> >
> >         $ git format-patch -M --stdout origin/master | git imap-send
> >
> > Go to your Gmail account, open the Drafts folder, find the patch email, fill
> > in the To: and CC: fields and send away!
> 
> However, the advice beginning "Submitting properly formatted patches
> via Gmail is simple now" doesn't match my experience.  Following those
> guidelines seemed to work, but my patch was line-wrapped anyway.
> 
> It seems I'm not the only person who's observed this:
> http://article.gmane.org/gmane.comp.version-control.git/133020
> 
> Can anyone think of anything I might have done wrong here?  If not,
> I'm inclined to suggest dropping all of that advice.  That's not
> ideal, because it leaves Gmail users with no obvious way to submit
> well-formatted patches to the list; but it's better than suggesting
> something which apparently doesn't work.
> 
> -- 
> Aaron Crane ** http://aaroncrane.co.uk/

I don't use the web interface at all, when I want to send out patches
using GMail (we use Google Apps for Business at $day_job).  I just use
"git send-email" and send the patch(es) out straight from the command
line.  There's a nice summary online [0] of how to get this setup with
GMail.

I don't get the handy address-book of the web interface, but I don't
have to worry about line-wrapping.

[0] http://morefedora.blogspot.com/2009/02/configuring-git-send-email-to-use-gmail.html

-- 
Jacob Helwig

```

## Sverre Rabbelier, 2010-02-06 20:59

Subject: Re: Gmail and unwanted line-wrapping
Message-ID: <fabb9a1e1002061259t78d3239dmdbe78d5136db8fab@mail.gmail.com>
URL: https://gitlist.dev/e/fabb9a1e1002061259t78d3239dmdbe78d5136db8fab%40mail.gmail.com
In-Reply-To: <20100206204917.GA30894@vfb-9.home>

```
Heya,

On Sat, Feb 6, 2010 at 21:49, Jacob Helwig <jacob.helwig@gmail.com> wrote:
> I don't get the handy address-book of the web interface, but I don't
> have to worry about line-wrapping.

I get both using the magic awesomeness that is copy/paste. (Figure out
who to mail in web interface, then copy/paste To: line to cmdline)

-- 
Cheers,

Sverre Rabbelier

```

## David Aguilar, 2010-02-07 00:24

Subject: Re: Gmail and unwanted line-wrapping
Message-ID: <20100207002413.GA14744@gmail.com>
URL: https://gitlist.dev/e/20100207002413.GA14744%40gmail.com
In-Reply-To: <fabb9a1e1002061247k7a8fba5at4c687faac0dcabb8@mail.gmail.com>

```
On Sat, Feb 06, 2010 at 09:47:39PM +0100, Sverre Rabbelier wrote:
> Heya,
> 
> On Sat, Feb 6, 2010 at 21:29, Aaron Crane <git@aaroncrane.co.uk> wrote:
> > Can anyone think of anything I might have done wrong here?  If not,
> > I'm inclined to suggest dropping all of that advice.  That's not
> > ideal, because it leaves Gmail users with no obvious way to submit
> > well-formatted patches to the list; but it's better than suggesting
> > something which apparently doesn't work.
> 
> I'm using git send-email with this configuration:
> [sendemail]
>   smtencryption = tls
>   smtpserver = smtp.gmai.com
>   smtpuser = srabbelier@gmail.com
>   smptserverport = 587
> 
> It'll ask you for your password when you're sending the emails. Like so:
> 
> $ git format-patch --no-color -C -M origin/master..topic-branch -o outgoing/
> $ git send-email --compose outgoing/00*
> 
> Of course you should substitute specific things as appropriate, I
> doubt you'll want to be sending your patches pretending to be me :P.
> 
> -- 
> Cheers,
> 
> Sverre Rabbelier

Great tip!

I've added it to the Git Wiki:
http://git.wiki.kernel.org/index.php/GitTips#Using_gmail_to_send_your_patches


Good stuff,

-- 
		David

```

## Jay Soffian, 2010-02-07 00:50

Subject: Re: Gmail and unwanted line-wrapping
Message-ID: <76718491002061650ge299426s22de5e00b26af108@mail.gmail.com>
URL: https://gitlist.dev/e/76718491002061650ge299426s22de5e00b26af108%40mail.gmail.com
In-Reply-To: <20100207002413.GA14744@gmail.com>

```
> I've added it to the Git Wiki:
> http://git.wiki.kernel.org/index.php/GitTips#Using_gmail_to_send_your_patches

If you're on MacOS X and have MacPorts installed, then install both
the curl and msmtp packages, then use an .msmtprc as follows:

defaults
tls on
tls_trust_file /opt/local/share/curl/curl-ca-bundle.crt
syslog LOG_MAIL

# gmail
account gmail
host smtp.gmail.com
port 587
auth on
from jaysoffian@gmail.com
user jaysoffian@gmail.com

# Default account
account default : gmail

Adjusting for you account of course. And in your git config:

[sendemail]
	smtpserver = /opt/local/bin/msmtp


Now why would you do this you ask instead of using git's built-in SMTP
support? Because I provided a patch to msmtp long ago that lets it
access your gmail password from Mac OS X's keychain. Note that it
looks for a password stored in the same format as Mail.app would store
it, see the msmtp man page for details.

FWIW, I think Gnome also has a keychain like thingy that msmtp can also query.

j.

```

## Jay Soffian, 2010-02-07 00:51

Subject: Re: Gmail and unwanted line-wrapping
Message-ID: <76718491002061651t2c10b9fcge3f139164dabe471@mail.gmail.com>
URL: https://gitlist.dev/e/76718491002061651t2c10b9fcge3f139164dabe471%40mail.gmail.com
In-Reply-To: <76718491002061650ge299426s22de5e00b26af108@mail.gmail.com>

```
On Sat, Feb 6, 2010 at 7:50 PM, Jay Soffian <jaysoffian@gmail.com> wrote:
> tls_trust_file /opt/local/share/curl/curl-ca-bundle.crt

Actually you need the curl-ca-bundle port.

j.

```

## Erik Faye-Lund, 2010-02-08 15:20

Subject: Re: Gmail and unwanted line-wrapping
Message-ID: <40aa078e1002080720y4fe67d1eue2860dff9e12e0bf@mail.gmail.com>
URL: https://gitlist.dev/e/40aa078e1002080720y4fe67d1eue2860dff9e12e0bf%40mail.gmail.com
In-Reply-To: <76718491002061650ge299426s22de5e00b26af108@mail.gmail.com>

```
On Sun, Feb 7, 2010 at 1:50 AM, Jay Soffian <jaysoffian@gmail.com> wrote:
>> I've added it to the Git Wiki:
>> http://git.wiki.kernel.org/index.php/GitTips#Using_gmail_to_send_your_patches
>
> If you're on MacOS X and have MacPorts installed, then install both
> the curl and msmtp packages, then use an .msmtprc as follows:
>

There's also an article on the msysGit-wiki about using msmtp to send patches:
http://code.google.com/p/msysgit/wiki/UsingSendEmail

-- 
Erik "kusma" Faye-Lund

```
