card-games is published, so its commit messages are permanent public record. The new hook refuses a session-link trailer and a Co-Authored-By trailer naming Claude or anthropic.com, and checks that any Assisted-by trailer reads NAME (for PERSON; MODEL). A message with no Assisted-by line passes: attribution stays the author's call. * hooks/commit-msg: New hook. * hooks/applypatch-msg: New hook; runs commit-msg for git am. * test/commit-msg-tests.el: New ERT tests that drive the sh hook. * Makefile (GITHOOKS): New variable. (hooks): Install all three hooks. (test-hooks): New target. (check): Run it. Assisted-by: Mentat (for Corwin; claude-opus-5-5)
11 lines
280 B
Bash
Executable file
11 lines
280 B
Bash
Executable file
#!/bin/sh
|
|
# hooks/applypatch-msg -- give patches applied with `git am' the same
|
|
# trailer check as an ordinary commit, by running hooks/commit-msg.
|
|
#
|
|
# Install: make hooks
|
|
|
|
hook=$(git rev-parse --git-path hooks/commit-msg)
|
|
if [ -x "$hook" ]; then
|
|
exec "$hook" "$@"
|
|
fi
|
|
exit 0
|