table of contents
STG-EMAIL(1) | StGit Manual | STG-EMAIL(1) |
NAME¶
stg-email - Format and send patches as email
SYNOPSIS¶
stg email format [OPTIONS] <patch>... stg email format [OPTIONS] --all stg email send [OPTIONS] <file|directory>... stg email send [OPTIONS] <patch>... stg email send [OPTIONS] --all stg email send --dump-aliases stg email help format stg email help send stg email help help
DESCRIPTION¶
Format and send patches as email.
A typical workflow is to first generate email files for each patch along with an optional cover letter using ‘stg email format. Then, after checking the email files’ contents, sending the emails using `stg email send. This workflow may be condensed to one step by specifying patch names to stg email send instead of email files.
The format and send subcommands are thin wrappers over git format-patch and git send-email, respectively. Refer to the git-format-patch(1) and git-send-email(1) manpages for more details about configuration and options.
COMMANDS¶
format
The patches to format may be specified as individual patch names or patch ranges of the form p0..p3, or --all may be used to format all applied patches. Note that the specified patches must be contiguous within the patch series.
By default, the email files will be output to the current directory, however use of the -o/--output-directory option is recommended since sending the email with stg email send <dir> is simpler than specifying all the email files individually.
A cover letter template may also be generated by specifying --cover-letter. A cover letter is recommended when sending multiple patches. The format.coverLetter configuration value may be set true to always generate a cover letter or auto to generate a cover letter when formatting more than one patch.
Recipients may be specified using the --to and --cc, or setting recipients may be deferred to stg email send.
Many aspects of the format behavior may be controlled via format.* configuration values. Refer to the git-config(1) and git-format-patch(1) man pages for more details.
send
This is a wrapper for git send-email. Refer to the git-send-email(1) man page for additional details.
The patches to send may be specified as files or directories generated by stg email format, or as patch names/ranges as would be supplied to stg email format. Specifying a directory will send all files in that directory.
The header of the email is configurable via command line options. The user will be prompted for any necessary information not specified on the command line or in the configuration.
Many aspects of the send behavior may be controlled via the sendemail.* configuration options. In particular, it is recommended to statically configure SMTP details such as sendemail.smtpServer, sendemail.smtpUser, etc. Refer to git-config(1) and git-send-email(1) man pages for more detail on all the available configuration options.
FORMAT OPTIONS¶
-b <branch>, --branch=<branch>
-a, --all
-G <option>, --git-opt=<option>
See the git-format-patch(1) man page. This option may be specified multiple times.
-o <dir>, --output-directory=<dir>
--cover-letter
-n, --numbered
-N, --no-numbered
--start-number=<n>
-v <n>, --reroll-count=<n>
--rfc
--subject-prefix=<prefix>
--quiet
-s, --signoff
--numbered-files
--suffix=<suffix>
-k, --keep-subject
--no-binary
--zero-commit
--to=<address>
--no-to
--cc=<address>
--no-cc
--in-reply-to=<message-id>
--add-header=<header>
--attach
--inline
--thread[=<style>]
The optional <style> argument can be either shallow or deep. shallow threading makes every mail a reply to the head of the series, where the head is chosen from the cover letter, the --in-reply-to, and the first patch mail, in this order. deep threading makes every mail a reply to the previous one.
The default is --no-thread, unless the format.thread configuration is set. If --thread is specified without a style, it defaults to the style specified by format.thread if any, or else shallow.
Beware that the default for git send-email is to thread emails itself. If you want git format-patch to take care of threading, you will want to ensure that threading is disabled for git send-email.
--no-thread
--signature=<signature>
--no-signature
--signature-file=<file>
--base=<committish>
--progress
--interdiff=<rev>
--range-diff=<refspec>
Note that diff options passed to the command affect how the primary product of format-patch is generated, and they are not passed to the underlying range-diff machinery used to generate the cover-letter material (this may change in the future).
--creation-factor=<n>
SEND OPTIONS¶
-b <branch>, --branch=<branch>
-a, --all
-G <option>, --git-opt=<option>
See the git-send-email(1) man page. This option may be specified multiple times.
--from=<address>
--to=<address>
This option may be specified multiple times.
--cc=<address>
This option may be specified multiple times.
--bcc=<address>
This option may be specified multiple times.
--subject=<subject>
--reply-to=<address>
--in-reply-to=<id>
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 illustration below where [PATCH v2 0/3] is in reply to [PATCH 0/2]:
[PATCH 0/2] Here is what I did...
[PATCH 1/2] Clean up and tests
[PATCH 2/2] Implementation
[PATCH v2 0/3] Here is a reroll
[PATCH v2 1/3] Clean up
[PATCH v2 2/3] New tests
[PATCH v2 3/3] Implementation
Only necessary if --compose is also set. If --compose is not set, this will be prompted for.
--compose
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 will not be sent, but From, Subject, and In-Reply-To headers will be used unless they are removed.
Missing From or In-Reply-To headers will be prompted for.
See the CONFIGURATION section of git-send-email(1) for sendemail.multiEdit.
--annotate
--identity=<id>
--no-thread
If disabled with --no-thread, those headers will not be added (unless specified with --in-reply-to). Default is the value of the sendemail.thread configuration value; if that is unspecified, default to --thread.
It is up to the user to ensure that no In-Reply-To header already exists when git send-email is asked to add it (especially note that git format-patch can be configured to do the threading itself). Failure to do so may not produce the expected result in the recipient’s MUA.
--confirm=<mode>
Default is the value of sendemail.confirm configuration value; if that is unspecified, default to auto unless any of the suppress options have been specified, in which case default to compose.
Confirmation modes:
--quiet
--dry-run
--dump-aliases
-n, --numbered
-N, --no-numbered
--start-number=<n>
-v <n>, --reroll-count=<n>
--rfc
--subject-prefix=<prefix>
STGIT¶
Part of the StGit suite - see stg(1)
09/20/2024 | StGit 2.4.12 |