feat: enforce No-Op Protection Policy via git hooks#2611
feat: enforce No-Op Protection Policy via git hooks#2611google-labs-jules[bot] wants to merge 7 commits into
Conversation
Adds a pre-commit hook to block empty and whitespace-only commits. Adds a commit-msg hook to block placeholder commit messages like 'agent update'.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
🚀 Deployment Details (Last updated: Jun 19, 2026, 11:38 AM PST) 🚀 Pushed to gh-pages; publish in progress
|
Adds a pre-commit hook to block empty and whitespace-only commits. Adds a commit-msg hook to block placeholder commit messages like 'agent update'.
arii
left a comment
There was a problem hiding this comment.
ANTI-AI-SLOP\n\n\n## FINDINGS\n\n\n## FINAL RECOMMENDATION\n<Approved | Approved with Minor Changes | Not Approved>\n\n
Inline Comments (Fallback due to Github line resolution errors)
- :1:
arii
left a comment
There was a problem hiding this comment.
ANTI-AI-SLOP\n\n\n## FINDINGS\n\n\n## FINAL RECOMMENDATION\n<Approved | Approved with Minor Changes | Not Approved>\n\n
Inline Comments (Fallback due to Github line resolution errors)
- :1:
arii
left a comment
There was a problem hiding this comment.
ANTI-AI-SLOP\n\n\n## FINDINGS\n\n\n## FINAL RECOMMENDATION\n<Approved | Approved with Minor Changes | Not Approved>\n\n
Inline Comments (Fallback due to Github line resolution errors)
- :1:
Adds a pre-commit hook to block empty and whitespace-only commits. Adds a commit-msg hook to block placeholder commit messages like 'agent update'.
arii
left a comment
There was a problem hiding this comment.
Comprehensive Review for PR #2611
CI Status: All checks passing.
Recommendation: Everything looks good from a CI perspective. All tests and linters pass. Ready for manual review/merge if no other concerns.
FINAL RECOMMENDATION
Approved
Adds a pre-commit hook to block empty and whitespace-only commits. Adds a commit-msg hook to block placeholder commit messages like 'agent update'.
🤖 AI Technical AuditANTI-AI-SLOPThe implementation relies on verbose bash scripting for logic better suited to lightweight validation. The FINAL RECOMMENDATIONApproved with Minor Changes Review automatically published via RepoAuditor. |
Thank you for the review. I have removed the restrictive whitespace check from the pre-commit hook to allow structural refactoring and linting fixes. I have also refactored the forbidden phrases into an external |
- Adds pre-commit hook to block empty commits - Adds commit-msg hook to block placeholder commits reading from `.githooks/forbidden-phrases.txt` - Removes the previous whitespace-only block as per reviewer feedback.
- Adds `.github/workflows/block-empty-jules-patches.yml` to block empty pull requests created by automated systems bypassing local hooks. - Refines `.githooks/pre-commit` to remove overly restrictive whitespace-only checks, based on reviewer feedback. - Refines `.githooks/commit-msg` to dynamically read restricted phrases from `.githooks/forbidden-phrases.txt`.
Fixes ShellCheck SC2086 (Double quote to prevent globbing and word splitting) inside the GitHub Actions workflow `block-empty-jules-patches.yml` that was causing `actionlint` to fail in CI.
Problem Statement
The current Git commit process allows for placeholder messages that do not convey meaningful changes, which can lead to confusion and miscommunication within the development team.
Goal
Implement the No-Op Protection Policy to ensure that all git commits contain meaningful changes and prohibit placeholder messages by utilizing
pre-commitandcommit-msghooks.Non-Goals
None.
Proposed Approach
The implementation will involve configuring
pre-commitandcommit-msghooks to validate commit messages. The.githooksdirectory configuration will continue to be used to manage these hooks.Alternatives Considered
None.
Architectural Impact
None.
Scope
The scope includes the establishment of the No-Op Protection Policy through the implementation of the necessary git hooks, ensuring that all future commits adhere to the requirement of meaningful messages.
UNDERSTAND THE ISSUE
The issue arises from the existing practice where developers may use placeholder commit messages, which detracts from version control clarity and can create challenges in tracking changes effectively.
DETERMINE APPROACH
The approach will be to set up and enforce
pre-commitandcommit-msghooks that reject commits with non-meaningful messages.SPECIFY SCOPE
The specific scope includes configuring the
.githooksdirectory to include the new hooks and testing them to ensure that they function as intended in rejecting inappropriate commit messages.DEFINITION OF DONE