aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/githooks.txt
diff options
context:
space:
mode:
authorMichael Strawbridge <michael.strawbridge@amd.com>2023-04-19 16:27:03 -0400
committerJunio C Hamano <gitster@pobox.com>2023-04-19 14:19:09 -0700
commita8022c5f7b678189135b6caa3fadb3d8ec0c0d48 (patch)
tree3d2d5787217c3096e3dcfb21e44ebccd715d2362 /Documentation/githooks.txt
parent56adddaa06d376f3977ee91e8a769cd85439d21c (diff)
downloadgit-a8022c5f7b678189135b6caa3fadb3d8ec0c0d48.tar.gz
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/githooks.txt')
-rw-r--r--Documentation/githooks.txt27
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
~~~~~~~~~~~~~~~~~~