git/templates
Robin Jarry 3c8d3adeae send-email: export patch counters in validate environment
When sending patch series (with a cover-letter or not)
sendemail-validate is called with every email/patch file independently
from the others. When one of the patches depends on a previous one, it
may not be possible to use this hook in a meaningful way. A hook that
wants to check some property of the whole series needs to know which
patch is the final one.

Expose the current and total number of patches to the hook via the
GIT_SENDEMAIL_PATCH_COUNTER and GIT_SENDEMAIL_PATCH_TOTAL environment
variables so that both incremental and global validation is possible.

Sharing any other state between successive invocations of the validate
hook must be done via external means. For example, by storing it in
a git config sendemail.validateWorktree entry.

Add a sample script with placeholder validations and update tests to
check that the counters are properly exported.

Suggested-by: Phillip Wood <phillip.wood123@gmail.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2023-04-14 10:41:15 -07:00
..
.gitignore
branches--
hooks--applypatch-msg.sample
hooks--commit-msg.sample
hooks--fsmonitor-watchman.sample fsmonitor: query watchman with right valid json 2022-06-07 10:00:49 -07:00
hooks--post-update.sample
hooks--pre-applypatch.sample
hooks--pre-commit.sample templates: fix deprecated type option --bool 2020-01-21 14:11:20 -08:00
hooks--pre-merge-commit.sample git-merge: honor pre-merge-commit hook 2019-08-07 12:37:33 -07:00
hooks--pre-push.sample hooks--pre-push.sample: use hash-agnostic zero OID 2020-09-23 09:31:45 -07:00
hooks--pre-rebase.sample
hooks--pre-receive.sample
hooks--prepare-commit-msg.sample
hooks--push-to-checkout.sample hook: add sample template for push-to-checkout 2020-10-16 08:47:02 -07:00
hooks--sendemail-validate.sample send-email: export patch counters in validate environment 2023-04-14 10:41:15 -07:00
hooks--update.sample hooks--update.sample: use hash-agnostic zero OID 2020-09-23 09:31:45 -07:00
info--exclude
Makefile Makefile: add "$(QUIET)" boilerplate to shared.mak 2022-03-03 14:14:55 -08:00
this--description