diff options
author | Michael Strawbridge <michael.strawbridge@amd.com> | 2023-04-19 22:27:03 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-04-19 23:19:09 +0200 |
commit | a8022c5f7b678189135b6caa3fadb3d8ec0c0d48 (patch) | |
tree | 3d2d5787217c3096e3dcfb21e44ebccd715d2362 /Documentation | |
parent | send-email: refactor header generation functions (diff) | |
download | git-a8022c5f7b678189135b6caa3fadb3d8ec0c0d48.tar.xz git-a8022c5f7b678189135b6caa3fadb3d8ec0c0d48.zip |
send-email: expose header information to git-send-email's sendemail-validate hook
To allow further flexibility in the Git hook, the SMTP header
information of the email which git-send-email intends to send, is now
passed as the 2nd argument to the sendemail-validate hook.
As an example, this can be useful for acting upon keywords in the
subject or specific email addresses.
Cc: Luben Tuikov <luben.tuikov@amd.com>
Cc: Junio C Hamano <gitster@pobox.com>
Cc: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Acked-by: Luben Tuikov <luben.tuikov@amd.com>
Signed-off-by: Michael Strawbridge <michael.strawbridge@amd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/githooks.txt | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index 62908602e7..9896ffafaf 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -595,10 +595,29 @@ processed by rebase. sendemail-validate ~~~~~~~~~~~~~~~~~~ -This hook is invoked by linkgit:git-send-email[1]. It takes a single parameter, -the name of the file that holds the e-mail to be sent. Exiting with a -non-zero status causes `git send-email` to abort before sending any -e-mails. +This hook is invoked by linkgit:git-send-email[1]. + +It takes these command line arguments. They are, +1. the name of the file which holds the contents of the email to be sent. +2. The name of the file which holds the SMTP headers of the email. + +The SMTP headers are passed in the exact same way as they are passed to the +user's Mail Transport Agent (MTA). In effect, the email given to the user's +MTA, is the contents of $2 followed by the contents of $1. + +An example of a few common headers is shown below. Take notice of the +capitalization and multi-line tab structure. + + From: Example <from@example.com> + To: to@example.com + Cc: cc@example.com, + A <author@example.com>, + One <one@example.com>, + two@example.com + Subject: PATCH-STRING + +Exiting with a non-zero status causes `git send-email` to abort +before sending any e-mails. fsmonitor-watchman ~~~~~~~~~~~~~~~~~~ |