diff options
-rw-r--r-- | patatt/__init__.py | 1 | ||||
-rwxr-xr-x | sendemail-validate-hook | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/patatt/__init__.py b/patatt/__init__.py index f5e6a9c..82e264f 100644 --- a/patatt/__init__.py +++ b/patatt/__init__.py @@ -1272,6 +1272,7 @@ def cmd_install_hook(cmdargs, config: dict): # noqa with open(hookfile, 'w') as fh: fh.write('#!/bin/sh\n') fh.write('# installed by patatt install-hook\n') + fh.write('grep -q "^GIT: " "${1}" && exit 0\n') fh.write('patatt sign --hook "${1}"\n') os.chmod(hookfile, 0o755) logger.critical('Hook installed as %s', hookfile) diff --git a/sendemail-validate-hook b/sendemail-validate-hook index 9096388..efa92fb 100755 --- a/sendemail-validate-hook +++ b/sendemail-validate-hook @@ -1,4 +1,10 @@ #!/usr/bin/env bash +if grep -q "^GIT: " "${1}"; then + # This is a cover letter template that will be modified by git-send-email. + # Refuse to sign it, as it's obviously going to be different at send time. + exit 0 +fi + if which patatt>/dev/null 2>&1; then # We have it in path, so just execute it patatt sign --hook "${1}" |