Repository navigation
Conversation
Strip Cursor's initiator Co-authored-by trailer after it is injected, and gate git commit via .cursor/hooks.json so AI authorship fails before the commit-authorship CI check.
Fix the beforeShellExecution matcher for JS RegExp, share the AI identity pattern, read GIT_* overrides from the command text, and restore hooksPath on test failure.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add repo hooks so Cloud Agent commits strip Cursor’s initiator
Co-authored-by: Zhe Li <linuxcity.jn@gmail.com>trailer and fail early whengit commitwould use AI authorship (the same check asscripts/ci/check-authorship.sh).Changes
.githooks/commit-msg+strip-coauthored-by.sh— strip the initiator trailerscripts/ci/ensure-cursor-commit-hooks.sh— point Cursor’s dispatcher at.githooks/and installcommit-msg.cursor.zz-strip-coauthorso it runs after Cursor’s co-author hook.cursor/hooks.json+.cursor/hooks/check-git-commit.sh—beforeShellExecutiongate forgit commit(human author required; block explicit Zhe trailer and--no-verify)scripts/ci/coding-tool-identity.sh— shared coding-tool identity pattern + parseGIT_*overrides from the command text.cursor/hooks*in.gitignore.githooks/README.mdandCONTRIBUTING.mdscripts/ci/commit-hooks_test.shFollow-up (
/no-comments)hooks.jsonmatcher to a JS-safegit\s+commit(POSIX[[:space:]]never matched)GIT_AUTHOR_*/GIT_COMMITTER_*from the command stringcore.hooksPathon failure via trapTest plan
bash scripts/ci/commit-hooks_test.shbash scripts/ci/check-authorship.sh origin/main HEADCo-authored-bytrailer--no-verify(afterensure-cursor-commit-hooks.sh)