summaryrefslogtreecommitdiffstats
path: root/githooks.txt
diff options
context:
space:
mode:
Diffstat (limited to 'githooks.txt')
-rw-r--r--githooks.txt22
1 files changed, 22 insertions, 0 deletions
diff --git a/githooks.txt b/githooks.txt
index 62908602e..c8e55b261 100644
--- a/githooks.txt
+++ b/githooks.txt
@@ -600,6 +600,28 @@ 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.
+The following environment variables are set when executing the hook.
+
+`GIT_SENDEMAIL_FILE_COUNTER`::
+ A 1-based counter incremented by one for every file holding an e-mail
+ to be sent (excluding any FIFOs). This counter does not follow the
+ patch series counter scheme. It will always start at 1 and will end at
+ GIT_SENDEMAIL_FILE_TOTAL.
+
+`GIT_SENDEMAIL_FILE_TOTAL`::
+ The total number of files that will be sent (excluding any FIFOs). This
+ counter does not follow the patch series counter scheme. It will always
+ be equal to the number of files being sent, whether there is a cover
+ letter or not.
+
+These variables may for instance be used to validate patch series.
+
+The sample `sendemail-validate` hook that comes with Git checks that all sent
+patches (excluding the cover letter) can be applied on top of the upstream
+repository default branch without conflicts. Some placeholders are left for
+additional validation steps to be performed after all patches of a given series
+have been applied.
+
fsmonitor-watchman
~~~~~~~~~~~~~~~~~~