threads / discuss / 22550

Gmail and unwanted line-wrapping

Subject: Gmail and unwanted line-wrapping

## tl;dr

8 messages between Feb 6, 2010 and Feb 8, 2010.

replies: 7people: 6as markdown or json

Aaron Crane· Feb 6, 2010, 20:29 UTC · lore

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

Show 9 quoted lines
> 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>
Show 10 quoted lines
> 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· Feb 6, 2010, 20:47 UTC · re: Aaron Crane · lore

Re: Gmail and unwanted line-wrapping

Heya,
On Sat, Feb 6, 2010 at 21:29, Aaron Crane <git@aaroncrane.co.uk> wrote:
Show 5 quoted lines
> 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
David Aguilar· Feb 7, 2010, 00:24 UTC · re: Sverre Rabbelier · lore

Re: Gmail and unwanted line-wrapping

On Sat, Feb 06, 2010 at 09:47:39PM +0100, Sverre Rabbelier wrote:
Show 28 quoted lines
> 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· Feb 7, 2010, 00:50 UTC · re: David Aguilar · lore

Re: Gmail and unwanted line-wrapping

> 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· Feb 7, 2010, 00:51 UTC · re: Jay Soffian · lore

Re: Gmail and unwanted line-wrapping

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· Feb 8, 2010, 15:20 UTC · re: Jay Soffian · lore

Re: Gmail and unwanted line-wrapping

On Sun, Feb 7, 2010 at 1:50 AM, Jay Soffian <jaysoffian@gmail.com> wrote:
Show 6 quoted lines
>> 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
Jacob Helwig· Feb 6, 2010, 20:49 UTC · re: Aaron Crane · lore

Re: Gmail and unwanted line-wrapping

On 20:29 Sat 06 Feb     , Aaron Crane wrote:
Show 39 quoted lines
> 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· Feb 6, 2010, 20:59 UTC · re: Jacob Helwig · lore

Re: Gmail and unwanted line-wrapping

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

← back to recent threads