1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
\r
4 <article lang="en" id="git-send-email(1)">
\r
6 <title>git-send-email(1)</title>
\r
8 <primary>git-send-email(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-send-email - Send a collection of patches as emails</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
18 <literallayout><emphasis>git send-email</emphasis> [options] <file|directory|rev-list options>…</literallayout>
\r
21 <simplesect id="_description">
\r
22 <title>DESCRIPTION</title>
\r
23 <simpara>Takes the patches given on the command line and emails them out.
\r
24 Patches can be specified as files, directories (which will send all
\r
25 files in the directory), or directly as a revision list. In the
\r
26 last case, any format accepted by <xref linkend="git-format-patch(1)" /> can
\r
27 be passed to git send-email.</simpara>
\r
28 <simpara>The header of the email is configurable by command line options. If not
\r
29 specified on the command line, the user will be prompted with a ReadLine
\r
30 enabled interface to provide the necessary information.</simpara>
\r
31 <simpara>There are two formats accepted for patch files:</simpara>
\r
32 <orderedlist numeration="arabic">
\r
37 <simpara>This is what <xref linkend="git-format-patch(1)" /> generates. Most headers and MIME
\r
38 formatting are ignored.</simpara>
\r
42 The original format used by Greg Kroah-Hartman's <emphasis>send_lots_of_email.pl</emphasis>
\r
45 <simpara>This format expects the first line of the file to contain the "Cc:" value
\r
46 and the "Subject:" of the message as the second line.</simpara>
\r
50 <simplesect id="_options">
\r
51 <title>OPTIONS</title>
\r
52 <section id="_composing">
\r
53 <title>Composing</title>
\r
61 Review and edit each patch you're about to send. See the
\r
62 CONFIGURATION section for <emphasis>sendemail.multiedit</emphasis>.
\r
68 --bcc=<address>
\r
72 Specify a "Bcc:" value for each email. Default is the value of
\r
73 <emphasis>sendemail.bcc</emphasis>.
\r
75 <simpara>The --bcc option must be repeated for each user you want on the bcc list.</simpara>
\r
80 --cc=<address>
\r
84 Specify a starting "Cc:" value for each email.
\r
85 Default is the value of <emphasis>sendemail.cc</emphasis>.
\r
87 <simpara>The --cc option must be repeated for each user you want on the cc list.</simpara>
\r
96 Invoke a text editor (see GIT_EDITOR in <xref linkend="git-var(1)" />)
\r
97 to edit an introductory message for the patch series.
\r
99 <simpara>When <emphasis>--compose</emphasis> is used, git send-email will use the From, Subject, and
\r
100 In-Reply-To headers specified in the message. If the body of the message
\r
101 (what you type after the headers and a blank line) only contains blank
\r
102 (or GIT: prefixed) lines the summary won't be sent, but From, Subject,
\r
103 and In-Reply-To headers will be used unless they are removed.</simpara>
\r
104 <simpara>Missing From or In-Reply-To headers will be prompted for.</simpara>
\r
105 <simpara>See the CONFIGURATION section for <emphasis>sendemail.multiedit</emphasis>.</simpara>
\r
110 --from=<address>
\r
114 Specify the sender of the emails. If not specified on the command line,
\r
115 the value of the <emphasis>sendemail.from</emphasis> configuration option is used. If
\r
116 neither the command line option nor <emphasis>sendemail.from</emphasis> are set, then the
\r
117 user will be prompted for the value. The default for the prompt will be
\r
118 the value of GIT_AUTHOR_IDENT, or GIT_COMMITTER_IDENT if that is not
\r
119 set, as returned by "git var -l".
\r
125 --in-reply-to=<identifier>
\r
129 Make the first mail (or all the mails with <emphasis>--no-thread</emphasis>) appear as a
\r
130 reply to the given Message-Id, which avoids breaking threads to
\r
131 provide a new patch series.
\r
132 The second and subsequent emails will be sent as replies according to
\r
133 the <emphasis>--[no]-chain-reply-to</emphasis> setting.
\r
135 <simpara>So for example when <emphasis>--thread</emphasis> and <emphasis>--no-chain-reply-to</emphasis> are specified, the
\r
136 second and subsequent patches will be replies to the first one like in the
\r
137 illustration below where <emphasis>[PATCH v2 0/3]</emphasis> is in reply to <emphasis>[PATCH 0/2]</emphasis>:</simpara>
\r
138 <literallayout class="monospaced">[PATCH 0/2] Here is what I did...
\r
139 [PATCH 1/2] Clean up and tests
\r
140 [PATCH 2/2] Implementation
\r
141 [PATCH v2 0/3] Here is a reroll
\r
142 [PATCH v2 1/3] Clean up
\r
143 [PATCH v2 2/3] New tests
\r
144 [PATCH v2 3/3] Implementation</literallayout>
\r
145 <simpara>Only necessary if --compose is also set. If --compose
\r
146 is not set, this will be prompted for.</simpara>
\r
151 --subject=<string>
\r
155 Specify the initial subject of the email thread.
\r
156 Only necessary if --compose is also set. If --compose
\r
157 is not set, this will be prompted for.
\r
163 --to=<address>
\r
167 Specify the primary recipient of the emails generated. Generally, this
\r
168 will be the upstream maintainer of the project involved. Default is the
\r
169 value of the <emphasis>sendemail.to</emphasis> configuration value; if that is unspecified,
\r
170 and --to-cmd is not specified, this will be prompted for.
\r
172 <simpara>The --to option must be repeated for each user you want on the to list.</simpara>
\r
177 --8bit-encoding=<encoding>
\r
181 When encountering a non-ASCII message or subject that does not
\r
182 declare its encoding, add headers/quoting to indicate it is
\r
183 encoded in <encoding>. Default is the value of the
\r
184 <emphasis>sendemail.assume8bitEncoding</emphasis>; if that is unspecified, this
\r
185 will be prompted for if any non-ASCII files are encountered.
\r
187 <simpara>Note that no attempts whatsoever are made to validate the encoding.</simpara>
\r
192 <section id="_sending">
\r
193 <title>Sending</title>
\r
197 --envelope-sender=<address>
\r
201 Specify the envelope sender used to send the emails.
\r
202 This is useful if your default address is not the address that is
\r
203 subscribed to a list. In order to use the <emphasis>From</emphasis> address, set the
\r
204 value to "auto". If you use the sendmail binary, you must have
\r
205 suitable privileges for the -f parameter. Default is the value of the
\r
206 <emphasis>sendemail.envelopesender</emphasis> configuration variable; if that is
\r
207 unspecified, choosing the envelope sender is left to your MTA.
\r
213 --smtp-encryption=<encryption>
\r
217 Specify the encryption to use, either <emphasis>ssl</emphasis> or <emphasis>tls</emphasis>. Any other
\r
218 value reverts to plain SMTP. Default is the value of
\r
219 <emphasis>sendemail.smtpencryption</emphasis>.
\r
225 --smtp-domain=<FQDN>
\r
229 Specifies the Fully Qualified Domain Name (FQDN) used in the
\r
230 HELO/EHLO command to the SMTP server. Some servers require the
\r
231 FQDN to match your IP address. If not set, git send-email attempts
\r
232 to determine your FQDN automatically. Default is the value of
\r
233 <emphasis>sendemail.smtpdomain</emphasis>.
\r
239 --smtp-pass[=<password>]
\r
243 Password for SMTP-AUTH. The argument is optional: If no
\r
244 argument is specified, then the empty string is used as
\r
245 the password. Default is the value of <emphasis>sendemail.smtppass</emphasis>,
\r
246 however <emphasis>--smtp-pass</emphasis> always overrides this value.
\r
248 <simpara>Furthermore, passwords need not be specified in configuration files
\r
249 or on the command line. If a username has been specified (with
\r
250 <emphasis>--smtp-user</emphasis> or a <emphasis>sendemail.smtpuser</emphasis>), but no password has been
\r
251 specified (with <emphasis>--smtp-pass</emphasis> or <emphasis>sendemail.smtppass</emphasis>), then the
\r
252 user is prompted for a password while the input is masked for privacy.</simpara>
\r
257 --smtp-server=<host>
\r
261 If set, specifies the outgoing SMTP server to use (e.g.
\r
262 <emphasis>smtp.example.com</emphasis> or a raw IP address). Alternatively it can
\r
263 specify a full pathname of a sendmail-like program instead;
\r
264 the program must support the <emphasis>-i</emphasis> option. Default value can
\r
265 be specified by the <emphasis>sendemail.smtpserver</emphasis> configuration
\r
266 option; the built-in default is <emphasis>/usr/sbin/sendmail</emphasis> or
\r
267 <emphasis>/usr/lib/sendmail</emphasis> if such program is available, or
\r
268 <emphasis>localhost</emphasis> otherwise.
\r
274 --smtp-server-port=<port>
\r
278 Specifies a port different from the default port (SMTP
\r
279 servers typically listen to smtp port 25, but may also listen to
\r
280 submission port 587, or the common SSL smtp port 465);
\r
281 symbolic port names (e.g. "submission" instead of 587)
\r
282 are also accepted. The port can also be set with the
\r
283 <emphasis>sendemail.smtpserverport</emphasis> configuration variable.
\r
289 --smtp-server-option=<option>
\r
293 If set, specifies the outgoing SMTP server option to use.
\r
294 Default value can be specified by the <emphasis>sendemail.smtpserveroption</emphasis>
\r
295 configuration option.
\r
297 <simpara>The --smtp-server-option option must be repeated for each option you want
\r
298 to pass to the server. Likewise, different lines in the configuration files
\r
299 must be used for each option.</simpara>
\r
308 Legacy alias for <emphasis>--smtp-encryption ssl</emphasis>.
\r
314 --smtp-user=<user>
\r
318 Username for SMTP-AUTH. Default is the value of <emphasis>sendemail.smtpuser</emphasis>;
\r
319 if a username is not specified (with <emphasis>--smtp-user</emphasis> or <emphasis>sendemail.smtpuser</emphasis>),
\r
320 then authentication is not attempted.
\r
330 Enable (1) or disable (0) debug output. If enabled, SMTP
\r
331 commands and replies will be printed. Useful to debug TLS
\r
332 connection and authentication problems.
\r
338 <section id="_automating">
\r
339 <title>Automating</title>
\r
343 --to-cmd=<command>
\r
347 Specify a command to execute once per patch file which
\r
348 should generate patch file specific "To:" entries.
\r
349 Output of this command must be single email address per line.
\r
350 Default is the value of <emphasis>sendemail.tocmd</emphasis> configuration value.
\r
356 --cc-cmd=<command>
\r
360 Specify a command to execute once per patch file which
\r
361 should generate patch file specific "Cc:" entries.
\r
362 Output of this command must be single email address per line.
\r
363 Default is the value of <emphasis>sendemail.cccmd</emphasis> configuration value.
\r
369 --[no-]chain-reply-to
\r
373 If this is set, each email will be sent as a reply to the previous
\r
374 email sent. If disabled with "--no-chain-reply-to", all emails after
\r
375 the first will be sent as replies to the first email sent. When using
\r
376 this, it is recommended that the first file given be an overview of the
\r
377 entire patch series. Disabled by default, but the <emphasis>sendemail.chainreplyto</emphasis>
\r
378 configuration variable can be used to enable it.
\r
384 --identity=<identity>
\r
388 A configuration identity. When given, causes values in the
\r
389 <emphasis>sendemail.<identity></emphasis> subsection to take precedence over
\r
390 values in the <emphasis>sendemail</emphasis> section. The default identity is
\r
391 the value of <emphasis>sendemail.identity</emphasis>.
\r
397 --[no-]signed-off-by-cc
\r
401 If this is set, add emails found in Signed-off-by: or Cc: lines to the
\r
402 cc list. Default is the value of <emphasis>sendemail.signedoffbycc</emphasis> configuration
\r
403 value; if that is unspecified, default to --signed-off-by-cc.
\r
409 --suppress-cc=<category>
\r
413 Specify an additional category of recipients to suppress the
\r
419 <emphasis>author</emphasis> will avoid including the patch author
\r
424 <emphasis>self</emphasis> will avoid including the sender
\r
429 <emphasis>cc</emphasis> will avoid including anyone mentioned in Cc lines in the patch header
\r
430 except for self (use <emphasis>self</emphasis> for that).
\r
435 <emphasis>bodycc</emphasis> will avoid including anyone mentioned in Cc lines in the
\r
436 patch body (commit message) except for self (use <emphasis>self</emphasis> for that).
\r
441 <emphasis>sob</emphasis> will avoid including anyone mentioned in Signed-off-by lines except
\r
442 for self (use <emphasis>self</emphasis> for that).
\r
447 <emphasis>cccmd</emphasis> will avoid running the --cc-cmd.
\r
452 <emphasis>body</emphasis> is equivalent to <emphasis>sob</emphasis> + <emphasis>bodycc</emphasis>
\r
457 <emphasis>all</emphasis> will suppress all auto cc values.
\r
461 <simpara>Default is the value of <emphasis>sendemail.suppresscc</emphasis> configuration value; if
\r
462 that is unspecified, default to <emphasis>self</emphasis> if --suppress-from is
\r
463 specified, as well as <emphasis>body</emphasis> if --no-signed-off-cc is specified.</simpara>
\r
468 --[no-]suppress-from
\r
472 If this is set, do not add the From: address to the cc: list.
\r
473 Default is the value of <emphasis>sendemail.suppressfrom</emphasis> configuration
\r
474 value; if that is unspecified, default to --no-suppress-from.
\r
484 If this is set, the In-Reply-To and References headers will be
\r
485 added to each email sent. Whether each mail refers to the
\r
486 previous email (<emphasis>deep</emphasis> threading per <emphasis>git format-patch</emphasis>
\r
487 wording) or to the first email (<emphasis>shallow</emphasis> threading) is
\r
488 governed by "--[no-]chain-reply-to".
\r
490 <simpara>If disabled with "--no-thread", those headers will not be added
\r
491 (unless specified with --in-reply-to). Default is the value of the
\r
492 <emphasis>sendemail.thread</emphasis> configuration value; if that is unspecified,
\r
493 default to --thread.</simpara>
\r
494 <simpara>It is up to the user to ensure that no In-Reply-To header already
\r
495 exists when <emphasis>git send-email</emphasis> is asked to add it (especially note that
\r
496 <emphasis>git format-patch</emphasis> can be configured to do the threading itself).
\r
497 Failure to do so may not produce the expected result in the
\r
498 recipient's MUA.</simpara>
\r
503 <section id="_administering">
\r
504 <title>Administering</title>
\r
508 --confirm=<mode>
\r
512 Confirm just before sending:
\r
517 <emphasis>always</emphasis> will always confirm before sending
\r
522 <emphasis>never</emphasis> will never confirm before sending
\r
527 <emphasis>cc</emphasis> will confirm before sending when send-email has automatically
\r
528 added addresses from the patch to the Cc list
\r
533 <emphasis>compose</emphasis> will confirm before sending the first message when using --compose.
\r
538 <emphasis>auto</emphasis> is equivalent to <emphasis>cc</emphasis> + <emphasis>compose</emphasis>
\r
542 <simpara>Default is the value of <emphasis>sendemail.confirm</emphasis> configuration value; if that
\r
543 is unspecified, default to <emphasis>auto</emphasis> unless any of the suppress options
\r
544 have been specified, in which case default to <emphasis>compose</emphasis>.</simpara>
\r
553 Do everything except actually send the emails.
\r
559 --[no-]format-patch
\r
563 When an argument may be understood either as a reference or as a file name,
\r
564 choose to understand it as a format-patch argument (<emphasis>--format-patch</emphasis>)
\r
565 or as a file name (<emphasis>--no-format-patch</emphasis>). By default, when such a conflict
\r
566 occurs, git send-email will fail.
\r
576 Make git-send-email less verbose. One line per email should be
\r
577 all that is output.
\r
587 Perform sanity checks on patches.
\r
588 Currently, validation means the following:
\r
593 Warn of patches that contain lines longer than 998 characters; this
\r
594 is due to SMTP limits as described by <ulink url="http://www.ietf.org/rfc/rfc2821.txt">http://www.ietf.org/rfc/rfc2821.txt</ulink>.
\r
598 <simpara>Default is the value of <emphasis>sendemail.validate</emphasis>; if this is not set,
\r
599 default to <emphasis>--validate</emphasis>.</simpara>
\r
608 Send emails even if safety checks would prevent it.
\r
615 <simplesect id="_configuration">
\r
616 <title>CONFIGURATION</title>
\r
620 sendemail.aliasesfile
\r
624 To avoid typing long email addresses, point this to one or more
\r
625 email aliases files. You must also supply <emphasis>sendemail.aliasfiletype</emphasis>.
\r
631 sendemail.aliasfiletype
\r
635 Format of the file(s) specified in sendemail.aliasesfile. Must be
\r
636 one of <emphasis>mutt</emphasis>, <emphasis>mailrc</emphasis>, <emphasis>pine</emphasis>, <emphasis>elm</emphasis>, or <emphasis>gnus</emphasis>.
\r
642 sendemail.multiedit
\r
646 If true (default), a single editor instance will be spawned to edit
\r
647 files you have to edit (patches when <emphasis>--annotate</emphasis> is used, and the
\r
648 summary when <emphasis>--compose</emphasis> is used). If false, files will be edited one
\r
649 after the other, spawning a new editor each time.
\r
659 Sets the default for whether to confirm before sending. Must be
\r
660 one of <emphasis>always</emphasis>, <emphasis>never</emphasis>, <emphasis>cc</emphasis>, <emphasis>compose</emphasis>, or <emphasis>auto</emphasis>. See <emphasis>--confirm</emphasis>
\r
661 in the previous section for the meaning of these values.
\r
667 <simplesect id="_example">
\r
668 <title>EXAMPLE</title>
\r
669 <section id="_use_gmail_as_the_smtp_server">
\r
670 <title>Use gmail as the smtp server</title>
\r
671 <simpara>To use <emphasis>git send-email</emphasis> to send your patches through the GMail SMTP server,
\r
672 edit ~/.gitconfig to specify your account settings:</simpara>
\r
673 <literallayout class="monospaced">[sendemail]
\r
674 smtpencryption = tls
\r
675 smtpserver = smtp.gmail.com
\r
676 smtpuser = yourname@gmail.com
\r
677 smtpserverport = 587</literallayout>
\r
678 <simpara>Once your commits are ready to be sent to the mailing list, run the
\r
679 following commands:</simpara>
\r
680 <literallayout class="monospaced">$ git format-patch --cover-letter -M origin/master -o outgoing/
\r
681 $ edit outgoing/0000-*
\r
682 $ git send-email outgoing/*</literallayout>
\r
683 <simpara>Note: the following perl modules are required
\r
684 Net::SMTP::SSL, MIME::Base64 and Authen::SASL</simpara>
\r
687 <simplesect id="_see_also">
\r
688 <title>SEE ALSO</title>
\r
689 <simpara><xref linkend="git-format-patch(1)" />, <xref linkend="git-imap-send(1)" />, mbox(5)</simpara>
\r
691 <simplesect id="_git">
\r
693 <simpara>Part of the <xref linkend="git(1)" /> suite</simpara>
\r