Imported Upstream version 2.19.5
[platform/upstream/git.git] / Documentation / git-send-email.txt
index d0b38b4..465a4ec 100644 (file)
@@ -9,7 +9,7 @@ git-send-email - Send a collection of patches as emails
 SYNOPSIS
 --------
 [verse]
-'git send-email' [options] <file|directory|rev-list options>...
+'git send-email' [<options>] <file|directory|rev-list options>...
 'git send-email' --dump-aliases
 
 
@@ -66,7 +66,7 @@ This option may be specified multiple times.
        Invoke a text editor (see GIT_EDITOR in linkgit:git-var[1])
        to edit an introductory message for the patch series.
 +
-When '--compose' is used, git send-email will use the From, Subject, and
+When `--compose` is used, git send-email will use the From, Subject, and
 In-Reply-To headers specified in the message. If the body of the message
 (what you type after the headers and a blank line) only contains blank
 (or Git: prefixed) lines, the summary won't be sent, but From, Subject,
@@ -84,12 +84,17 @@ See the CONFIGURATION section for `sendemail.multiEdit`.
        the value of GIT_AUTHOR_IDENT, or GIT_COMMITTER_IDENT if that is not
        set, as returned by "git var -l".
 
+--reply-to=<address>::
+       Specify the address where replies from recipients should go to.
+       Use this if replies to messages should go to another address than what
+       is specified with the --from parameter.
+
 --in-reply-to=<identifier>::
        Make the first mail (or all the mails with `--no-thread`) appear as a
        reply to the given Message-Id, which avoids breaking threads to
        provide a new patch series.
        The second and subsequent emails will be sent as replies according to
-       the `--[no]-chain-reply-to` setting.
+       the `--[no-]chain-reply-to` setting.
 +
 So for example when `--thread` and `--no-chain-reply-to` are specified, the
 second and subsequent patches will be replies to the first one like in the
@@ -132,15 +137,17 @@ Note that no attempts whatsoever are made to validate the encoding.
        Specify encoding of compose message. Default is the value of the
        'sendemail.composeencoding'; if that is unspecified, UTF-8 is assumed.
 
---transfer-encoding=(7bit|8bit|quoted-printable|base64)::
+--transfer-encoding=(7bit|8bit|quoted-printable|base64|auto)::
        Specify the transfer encoding to be used to send the message over SMTP.
        7bit will fail upon encountering a non-ASCII message.  quoted-printable
        can be useful when the repository contains files that contain carriage
        returns, but makes the raw patch email file (as saved from a MUA) much
        harder to inspect manually.  base64 is even more fool proof, but also
-       even more opaque.  Default is the value of the `sendemail.transferEncoding`
-       configuration value; if that is unspecified, git will use 8bit and not
-       add a Content-Transfer-Encoding header.
+       even more opaque.  auto will use 8bit when possible, and quoted-printable
+       otherwise.
++
+Default is the value of the `sendemail.transferEncoding` configuration
+value; if that is unspecified, default to `auto`.
 
 --xmailer::
 --no-xmailer::
@@ -182,19 +189,19 @@ $ git send-email --smtp-auth="PLAIN LOGIN GSSAPI" ...
 +
 If at least one of the specified mechanisms matches the ones advertised by the
 SMTP server and if it is supported by the utilized SASL library, the mechanism
-is used for authentication. If neither 'sendemail.smtpAuth' nor '--smtp-auth'
+is used for authentication. If neither 'sendemail.smtpAuth' nor `--smtp-auth`
 is specified, all mechanisms supported by the SASL library can be used.
 
 --smtp-pass[=<password>]::
        Password for SMTP-AUTH. The argument is optional: If no
        argument is specified, then the empty string is used as
        the password. Default is the value of `sendemail.smtpPass`,
-       however '--smtp-pass' always overrides this value.
+       however `--smtp-pass` always overrides this value.
 +
 Furthermore, passwords need not be specified in configuration files
 or on the command line. If a username has been specified (with
-'--smtp-user' or a `sendemail.smtpUser`), but no password has been
-specified (with '--smtp-pass' or `sendemail.smtpPass`), then
+`--smtp-user` or a `sendemail.smtpUser`), but no password has been
+specified (with `--smtp-pass` or `sendemail.smtpPass`), then
 a password is obtained using 'git-credential'.
 
 --smtp-server=<host>::
@@ -203,9 +210,9 @@ a password is obtained using 'git-credential'.
        specify a full pathname of a sendmail-like program instead;
        the program must support the `-i` option.  Default value can
        be specified by the `sendemail.smtpServer` configuration
-       option; the built-in default is `/usr/sbin/sendmail` or
-       `/usr/lib/sendmail` if such program is available, or
-       `localhost` otherwise.
+       option; the built-in default is to search for `sendmail` in
+       `/usr/sbin`, `/usr/lib` and $PATH if such program is
+       available, falling back to `localhost` otherwise.
 
 --smtp-server-port=<port>::
        Specifies a port different from the default port (SMTP
@@ -240,7 +247,7 @@ must be used for each option.
 
 --smtp-user=<user>::
        Username for SMTP-AUTH. Default is the value of `sendemail.smtpUser`;
-       if a username is not specified (with '--smtp-user' or `sendemail.smtpUser`),
+       if a username is not specified (with `--smtp-user` or `sendemail.smtpUser`),
        then authentication is not attempted.
 
 --smtp-debug=0|1::
@@ -248,6 +255,21 @@ must be used for each option.
        commands and replies will be printed. Useful to debug TLS
        connection and authentication problems.
 
+--batch-size=<num>::
+       Some email servers (e.g. smtp.163.com) limit the number emails to be
+       sent per session (connection) and this will lead to a failure when
+       sending many messages.  With this option, send-email will disconnect after
+       sending $<num> messages and wait for a few seconds (see --relogin-delay)
+       and reconnect, to work around such a limit.  You may want to
+       use some form of credential helper to avoid having to retype
+       your password every time this happens.  Defaults to the
+       `sendemail.smtpBatchSize` configuration variable.
+
+--relogin-delay=<int>::
+       Waiting $<int> seconds before reconnecting to SMTP server. Used together
+       with --batch-size option.  Defaults to the `sendemail.smtpReloginDelay`
+       configuration variable.
+
 Automating
 ~~~~~~~~~~
 
@@ -364,8 +386,8 @@ have been specified, in which case default to 'compose'.
 
 --[no-]format-patch::
        When an argument may be understood either as a reference or as a file name,
-       choose to understand it as a format-patch argument ('--format-patch')
-       or as a file name ('--no-format-patch'). By default, when such a conflict
+       choose to understand it as a format-patch argument (`--format-patch`)
+       or as a file name (`--no-format-patch`). By default, when such a conflict
        occurs, git send-email will fail.
 
 --quiet::
@@ -377,12 +399,16 @@ have been specified, in which case default to 'compose'.
        Currently, validation means the following:
 +
 --
-               *       Warn of patches that contain lines longer than 998 characters; this
-                       is due to SMTP limits as described by http://www.ietf.org/rfc/rfc2821.txt.
+               *       Invoke the sendemail-validate hook if present (see linkgit:githooks[5]).
+               *       Warn of patches that contain lines longer than
+                       998 characters unless a suitable transfer encoding
+                       ('auto', 'base64', or 'quoted-printable') is used;
+                       this is due to SMTP limits as described by
+                       http://www.ietf.org/rfc/rfc5322.txt.
 --
 +
 Default is the value of `sendemail.validate`; if this is not set,
-default to '--validate'.
+default to `--validate`.
 
 --force::
        Send emails even if safety checks would prevent it.
@@ -428,17 +454,17 @@ sendmail;;
 
 sendemail.multiEdit::
        If true (default), a single editor instance will be spawned to edit
-       files you have to edit (patches when '--annotate' is used, and the
-       summary when '--compose' is used). If false, files will be edited one
+       files you have to edit (patches when `--annotate` is used, and the
+       summary when `--compose` is used). If false, files will be edited one
        after the other, spawning a new editor each time.
 
 sendemail.confirm::
        Sets the default for whether to confirm before sending. Must be
-       one of 'always', 'never', 'cc', 'compose', or 'auto'. See '--confirm'
+       one of 'always', 'never', 'cc', 'compose', or 'auto'. See `--confirm`
        in the previous section for the meaning of these values.
 
-EXAMPLE
--------
+EXAMPLES
+--------
 Use gmail as the smtp server
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 To use 'git send-email' to send your patches through the GMail SMTP server,
@@ -452,16 +478,7 @@ edit ~/.gitconfig to specify your account settings:
 
 If you have multifactor authentication setup on your gmail account, you will
 need to generate an app-specific password for use with 'git send-email'. Visit
-https://security.google.com/settings/security/apppasswords to setup an
-app-specific password.  Once setup, you can store it with the credentials
-helper:
-
-       $ git credential fill
-       protocol=smtp
-       host=smtp.gmail.com
-       username=youname@gmail.com
-       password=app-password
-
+https://security.google.com/settings/security/apppasswords to create it.
 
 Once your commits are ready to be sent to the mailing list, run the
 following commands:
@@ -470,6 +487,11 @@ following commands:
        $ edit outgoing/0000-*
        $ git send-email outgoing/*
 
+The first time you run it, you will be prompted for your credentials.  Enter the
+app-specific or your regular password as appropriate.  If you have credential
+helper configured (see linkgit:git-credential[1]), the password will be saved in
+the credential store so you won't have to type it the next time.
+
 Note: the following perl modules are required
       Net::SMTP::SSL, MIME::Base64 and Authen::SASL