summaryrefslogtreecommitdiff
path: root/plugins/security-guidance/hooks/gitutil.py
diff options
context:
space:
mode:
authorMohamed Hegazy <mhegazy@anthropic.com>2026-11-04 19:38:34 +0000
committerClaude <noreply@anthropic.com>2026-11-04 19:38:34 +0000
commit0610eb807de91eb829f4bf9354cfd4bcb45bdcc6 (patch)
tree59997536d7ff6585ed50a328358a62aa4a384cfb /plugins/security-guidance/hooks/gitutil.py
parentfa4eb54397ee2faccb6940512a19c017cb1337f3 (diff)
security-guidance: read git log output without signature checksmhegazy/sg-git-log-signature-off
With log.showSignature set, git log and git show verify every signed commit, which adds lines to the output the hooks parse and starts gpg.program. Set it off for the hooks' git and for the commit reviewer's environment. Co-authored-by: mhegazy <mhegazy@anthropic.com>
Diffstat (limited to 'plugins/security-guidance/hooks/gitutil.py')
-rw-r--r--plugins/security-guidance/hooks/gitutil.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/security-guidance/hooks/gitutil.py b/plugins/security-guidance/hooks/gitutil.py
index ec51e3c6..1354a782 100644
--- a/plugins/security-guidance/hooks/gitutil.py
+++ b/plugins/security-guidance/hooks/gitutil.py
@@ -62,6 +62,10 @@ GIT_CMD = [
# _drop_gitlinks for the commands that take no such setting.
"-c", "diff.ignoreSubmodules=all",
"-c", "diff.submodule=short",
+ # `git log` and `git show` print commit metadata for the hooks to parse.
+ # With log.showSignature set they would also verify each signed commit,
+ # adding lines to the output and starting the program gpg.program names.
+ "-c", "log.showSignature=false",
]
# diff.ignoreSubmodules is a default that the repository's own settings for
@@ -74,6 +78,7 @@ SAFE_GIT_CONFIG = (
("core.hooksPath", "/dev/null"),
("diff.ignoreSubmodules", "all"),
("diff.submodule", "short"),
+ ("log.showSignature", "false"),
)
# The hook's git runs in the background beside the session's own git. Without