aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/githooks.txt
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-05-10 10:23:28 -0700
committerJunio C Hamano <gitster@pobox.com>2023-05-10 10:23:28 -0700
commitb6e9521956b752be4c666efedd7b91bdd05f9756 (patch)
tree018a956cf58a4f0ddce4b8fe4ebf3dd926a9f00f /Documentation/githooks.txt
parente2abfa7212525daa24a52d9f53c45b736abb5dfe (diff)
parenta8022c5f7b678189135b6caa3fadb3d8ec0c0d48 (diff)
downloadgit-b6e9521956b752be4c666efedd7b91bdd05f9756.tar.gz
Merge branch 'ms/send-email-feed-header-to-validate-hook'
"git send-email" learned to give the e-mail headers to the validate hook by passing an extra argument from the command line. * ms/send-email-feed-header-to-validate-hook: send-email: expose header information to git-send-email's sendemail-validate hook send-email: refactor header generation functions
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 c8e55b2613..86f804720a 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.
The following environment variables are set when executing the hook.