Skip to content

Commit

Permalink
Documentation: publicize hints for sending patches with GMail
Browse files Browse the repository at this point in the history
The hints in SubmittingPatches about stopping GMail from clobbering
patches are widely useful both as examples of "git send-email" and
"git imap-send" usage.

Move the documentation to the appropriate places.

While at it, don't encourage storing passwords in config files.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
jrn authored and gitster committed Apr 15, 2011
1 parent 967ab8e commit 36c10e6
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 55 deletions.
54 changes: 2 additions & 52 deletions Documentation/SubmittingPatches
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ that or Gentoo did it.) So you need to set the
it.


Thunderbird, KMail
------------------
Thunderbird, KMail, GMail
-------------------------

See the MUA-SPECIFIC HINTS section of git-format-patch(1).

Expand All @@ -431,53 +431,3 @@ characters (most notably in people's names), and also
whitespaces (fatal in patches). Running 'C-u g' to display the
message in raw form before using '|' to run the pipe can work
this problem around.


Gmail
-----

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 "git send-email" and send your patches through the GMail SMTP server, or
use any IMAP email client to connect to the google IMAP server and forward
the emails through that.

To use "git send-email" and send your patches through the GMail SMTP server,
edit ~/.gitconfig to specify your account settings:

[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
smtpuser = user@gmail.com
smtppass = p4ssw0rd
smtpserverport = 587

Once your commits are ready to be sent to the mailing list, run the
following commands:

$ git format-patch --cover-letter -M origin/master -o outgoing/
$ edit outgoing/0000-*
$ git send-email outgoing/*

To submit using the IMAP interface, first, edit your ~/.gitconfig to specify your
account settings:

[imap]
folder = "[Gmail]/Drafts"
host = imaps://imap.gmail.com
user = user@gmail.com
pass = p4ssw0rd
port = 993
sslverify = false

You might need to instead use: folder = "[Google Mail]/Drafts" if you get an error
that the "Folder doesn't exist".

Once your commits are ready to be sent to the mailing list, run the
following commands:

$ git format-patch --cover-letter -M --stdout origin/master | git imap-send

Just make sure to disable line wrapping in the email client (GMail web
interface will line wrap no matter what, so you need to use a real
IMAP client).
14 changes: 14 additions & 0 deletions Documentation/git-format-patch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,20 @@ MUA-SPECIFIC HINTS
Here are some hints on how to successfully submit patches inline using
various mailers.

GMail
~~~~~
GMail does not have any way to turn off line wrapping in the web
interface, so it will mangle any emails that you send. You can however
use "git send-email" and send your patches through the GMail SMTP server, or
use any IMAP email client to connect to the google IMAP server and forward
the emails through that.

For hints on using 'git send-email' to send your patches through the
GMail SMTP server, see the EXAMPLE section of linkgit:git-send-email[1].

For hints on submission using the IMAP interface, see the EXAMPLE
section of linkgit:git-imap-send[1].

Thunderbird
~~~~~~~~~~~
By default, Thunderbird will both wrap emails as well as flag
Expand Down
29 changes: 29 additions & 0 deletions Documentation/git-imap-send.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,31 @@ Using direct mode with SSL:
..........................


EXAMPLE
-------
To submit patches using GMail's IMAP interface, first, edit your ~/.gitconfig
to specify your account settings:

---------
[imap]
folder = "[Gmail]/Drafts"
host = imaps://imap.gmail.com
user = user@gmail.com
port = 993
sslverify = false
---------

You might need to instead use: folder = "[Google Mail]/Drafts" if you get an error
that the "Folder doesn't exist".

Once the commits are ready to be sent, run the following command:

$ git format-patch --cover-letter -M --stdout origin/master | git imap-send

Just make sure to disable line wrapping in the email client (GMail's web
interface will wrap lines no matter what, so you need to use a real
IMAP client).

CAUTION
-------
It is still your responsibility to make sure that the email message
Expand All @@ -124,6 +149,10 @@ Thunderbird in particular is known to be problematic. Thunderbird
users may wish to visit this web page for more information:
http://kb.mozillazine.org/Plain_text_e-mail_-_Thunderbird#Completely_plain_email

SEE ALSO
--------
linkgit:git-format-patch[1], linkgit:git-send-email[1], mbox(5)

GIT
---
Part of the linkgit:git[1] suite
19 changes: 16 additions & 3 deletions Documentation/git-send-email.txt
Original file line number Diff line number Diff line change
Expand Up @@ -348,20 +348,33 @@ sendemail.confirm::
one of 'always', 'never', 'cc', 'compose', or 'auto'. See '--confirm'
in the previous section for the meaning of these values.

EXAMPLE
-------
Use gmail as the smtp server
----------------------------

Add the following section to the config file:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To use 'git send-email' to send your patches through the GMail SMTP server,
edit ~/.gitconfig to specify your account settings:

[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
smtpuser = yourname@gmail.com
smtpserverport = 587

Once your commits are ready to be sent to the mailing list, run the
following commands:

$ git format-patch --cover-letter -M origin/master -o outgoing/
$ edit outgoing/0000-*
$ git send-email outgoing/*

Note: the following perl modules are required
Net::SMTP::SSL, MIME::Base64 and Authen::SASL

SEE ALSO
--------
linkgit:git-format-patch[1], linkgit:git-imap-send[1], mbox(5)

GIT
---
Part of the linkgit:git[1] suite

0 comments on commit 36c10e6

Please sign in to comment.