Skip to content

cleanup: remove obsolete git hooks infrastructure - #1382

Closed
atxtechbro wants to merge 2 commits into
mainfrom
cleanup/remove-obsolete-git-hooks-infrastructure
Closed

cleanup: remove obsolete git hooks infrastructure#1382
atxtechbro wants to merge 2 commits into
mainfrom
cleanup/remove-obsolete-git-hooks-infrastructure

Conversation

@atxtechbro

Copy link
Copy Markdown
Owner

Summary

Remove obsolete git hooks infrastructure, applying Invest, Simplify, and Subtraction Creates Value principles.

Principles Applied

  • Invest: Keep .githooks/ with core.hooksPath (modern, version-controlled approach)
  • Simplify: Remove manual installation complexity and duplication
  • Subtraction Creates Value: Delete obsolete code that no longer serves a purpose

Changes

Removed

  • hooks/ directory (outdated pre-push hook from Aug 5)
  • bin/install-git-hooks (obsolete manual installation script)

Why This Is Better

The .githooks/ + core.hooksPath approach (configured in setup.sh:613):

  • Version controlled - hooks travel with the repo
  • Automatic setup - no manual installation needed
  • Single source of truth - no duplication
  • Works in worktrees - consistent across all clones

Evolution Timeline

  1. Aug 5, 2025 - Created hooks/ + bin/install-git-hooks during MCP experiment (issue Experiment: Test Claude Code without git/github MCP servers #1213)
  2. Sept 4, 2025 - Fixed with .githooks/ + core.hooksPath configuration (issue fix: add pre-push hook to prevent accidental direct pushes to main #1300)
  3. Today - Removing technical debt left from the experiment

What Remains Active

  • .githooks/pre-commit - Validates Claude command synchronization
  • .githooks/pre-push - Prevents direct pushes to main branch
  • setup.sh - Automatically configures core.hooksPath on installation

Test Plan

  • Verified git still uses .githooks/ (via git config --get core.hooksPath)
  • Confirmed no documentation references to old approach
  • Both active hooks tested and working
  • 50 lines of obsolete code removed

Impact

  • Code Quality: Single source of truth, no duplication
  • Developer Experience: Automatic hook setup, no manual steps
  • Maintenance: Less code to maintain, clearer structure

CHANGELOG.md was created June 19, 2025 with the intent to document
notable changes following the Snowball Method principle. However, it
was abandoned after only 4 entries over a 24-day period (July 13, 2025).

Since then, 483 commits have been made with zero CHANGELOG updates,
proving the approach was unsustainable. The manual curation overhead
provided no value beyond what git commit history already captures through
structured commit messages.

The Snowball Method principle continues to thrive through:
- Living knowledge base (12 files actively reference it)
- knowledge/principles/snowball-method.md (recently enhanced with MLflow)
- Automated procedures and workflows (not manual documentation)

Stats:
- Active period: June 19 - July 13 (24 days)
- Total entries: 4 (~0.9% of commits during that period)
- Months abandoned: 3
- Lines removed: 35

Principle: subtraction-creates-value (removing manual process that
failed in practice)
Principles Applied:
- Invest: Keep .githooks/ with core.hooksPath (modern, version-controlled)
- Simplify: Remove manual installation complexity
- Subtraction Creates Value: Delete duplication and obsolete code

Removed:
- hooks/ directory (outdated pre-push from Aug 5)
- bin/install-git-hooks (obsolete manual installation script)

Why This Is Better:
The .githooks/ + core.hooksPath approach (configured in setup.sh:613):
✓ Version controlled - hooks travel with the repo
✓ Automatic setup - no manual installation needed
✓ Single source of truth - no duplication
✓ Works in worktrees - consistent across all clones

Evolution:
- Aug 5: Created hooks/ + bin/install-git-hooks (issue #1213)
- Sept 4: Fixed with .githooks/ + core.hooksPath (issue #1300)
- Today: Removing technical debt from the experiment

What Remains Active:
- .githooks/pre-commit (validates Claude command sync)
- .githooks/pre-push (prevents direct pushes to main)
- setup.sh configures core.hooksPath automatically
@amazon-q-developer

Copy link
Copy Markdown
Contributor

Code review in progress. Analyzing for code quality issues and best practices. Detailed findings will be posted upon completion.

Using Amazon Q Developer for GitHub

Amazon Q Developer1 is an AI-powered assistant that integrates directly into your GitHub workflow, enhancing your development process with intelligent features for code development, review, and transformation.

Slash Commands

Command Description
/q <message> Chat with the agent to ask questions or request revisions
/q review Requests an Amazon Q powered code review
/q help Displays usage information

Features

Agentic Chat
Enables interactive conversation with Amazon Q to ask questions about the pull request or request specific revisions. Use /q <message> in comment threads or the review body to engage with the agent directly.

Code Review
Analyzes pull requests for code quality, potential issues, and security concerns. Provides feedback and suggested fixes. Automatically triggered on new or reopened PRs (can be disabled for AWS registered installations), or manually with /q review slash command in a comment.

Customization

You can create project-specific rules for Amazon Q Developer to follow:

  1. Create a .amazonq/rules folder in your project root.
  2. Add Markdown files in this folder to define rules (e.g., cdk-rules.md).
  3. Write detailed prompts in these files, such as coding standards or best practices.
  4. Amazon Q Developer will automatically use these rules when generating code or providing assistance.

Example rule:

All Amazon S3 buckets must have encryption enabled, enforce SSL, and block public access.
All Amazon DynamoDB Streams tables must have encryption enabled.
All Amazon SNS topics must have encryption enabled and enforce SSL.
All Amazon SNS queues must enforce SSL.

Feedback

To provide feedback on Amazon Q Developer, create an issue in the Amazon Q Developer public repository.

For more detailed information, visit the Amazon Q for GitHub documentation.

Footnotes

  1. Amazon Q Developer uses generative AI. You may need to verify generated code before using it in your environment. See the AWS Responsible AI Policy.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall Assessment

This PR successfully achieves its stated goal of removing obsolete git hooks infrastructure and applying good software engineering principles. The cleanup eliminates duplication and technical debt while maintaining functionality through the modern .githooks/ + core.hooksPath approach.

Key Strengths

Clear Intent: The PR description excellently explains the evolution from manual installation to automated configuration
Proper Cleanup: Removes 85 lines of obsolete code while preserving functionality
Good Architecture: The remaining .githooks/ approach is superior (version-controlled, automatic, works in worktrees)
Verified Configuration: The setup.sh properly configures core.hooksPath at line 613

Main Concern

The removal of CHANGELOG.md appears to be outside the scope of git hooks cleanup and removes valuable historical documentation. Consider preserving this file as it provides useful context for repository evolution and follows good documentation practices.

Recommendation

Approve with minor suggestion: Consider keeping CHANGELOG.md as it's unrelated to the git hooks cleanup and provides valuable historical context. The core git hooks cleanup is well-executed and improves the codebase architecture.

Comment thread CHANGELOG.md Outdated

- One line per change, max 120 characters
- Include principle in parentheses when relevant
- Focus on what changed and why, not implementation details

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of CHANGELOG.md seems inconsistent with the PR's stated goal of removing only obsolete git hooks infrastructure. The changelog contains valuable historical information about the repository's evolution and doesn't appear to be related to the git hooks cleanup. Consider keeping this file as it provides useful context for future maintainers and follows good documentation practices.

Comment thread bin/install-git-hooks
echo ""
echo "Git hooks installed successfully!"
echo "These hooks provide protection while testing without MCP servers."
echo "See issue #1213 for details." No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good removal of the obsolete manual installation script. This aligns perfectly with the PR's goal of eliminating the old hooks infrastructure in favor of the automated .githooks/ + core.hooksPath approach configured in setup.sh.

Comment thread hooks/pre-push
fi
done

exit 0 No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of this duplicate pre-push hook is appropriate since the functionality is now handled by .githooks/pre-push. However, I notice the current .githooks/pre-push has improved error handling with the || { echo "⚠️ Warning: Could not determine current branch"; } construct, while this removed version would fail silently if git symbolic-ref HEAD failed. The cleanup maintains the better implementation.

@atxtechbro atxtechbro closed this Oct 10, 2025
@atxtechbro
atxtechbro deleted the cleanup/remove-obsolete-git-hooks-infrastructure branch October 10, 2025 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant