From 046b6e34ee6b53e274f03b59c895df40494eb923 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Sun, 16 Jul 2023 16:06:09 +0200 Subject: contrib: update sendemail-validate hook With git 2.41, git send-email exports a patch counter to the validate hook. Copy the example hook from git and adapt it for aerc. Link: https://github.com/git/git/commit/3c8d3adeae83 Signed-off-by: Robin Jarry Acked-by: Tim Culverhouse --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 55a0b93c..acd8a728 100644 --- a/Makefile +++ b/Makefile @@ -206,10 +206,12 @@ uninstall: gitconfig: git config format.subjectPrefix "PATCH aerc" git config sendemail.to "~rjarry/aerc-devel@lists.sr.ht" - git config sendemail.validate true @mkdir -p .git/hooks - @rm -f .git/hooks/sendemail-validate - ln -sf ../../contrib/sendemail-validate .git/hooks/sendemail-validate-series + @rm -f .git/hooks/sendemail-validate* + @if grep -q GIT_SENDEMAIL_FILE_COUNTER `git --exec-path`/git-send-email 2>/dev/null; then \ + ln -svf ../../contrib/sendemail-validate .git/hooks/sendemail-validate && \ + git config sendemail.validate true; \ + fi .PHONY: check-patches check-patches: -- cgit