Git Hooks Configuration
Current Setup (July 4, 2025)
Active Hooks
-
Pre-commit Hook (
pre-commit-hook-optimized.sh)- Validates Pine Script syntax and structure
- Auto-updates changelog timestamps
- Focuses on validation only
-
Post-commit Hook (
post-commit-hook-fixed.sh)- Auto-increments version numbers based on commit messages
- Runs complete workflow automation
- Includes infinite loop prevention
- Creates follow-up commits with generated files
Commit Message Patterns for Version Bumping
feat:orfeature:→ Minor version bump (1.0.0 → 1.1.0)breaking:orBREAKING:→ Major version bump (1.0.0 → 2.0.0)- Default → Patch version bump (1.0.0 → 1.0.1)
Skip Options
[skip workflow]or[no workflow]- Skip pre-commit workflow[skip ci]or[no hooks]- Skip post-commit automation--no-verify- Skip all hooks
Workflow Files Generated Automatically
README.md- Updated version badges and contentdocs/tv-description.txt- TradingView publication descriptiontesting-checklist.md- QA checklist for testing- Pine script - Version increments and changelog updates
Installation Commands
# Install pre-commit hook (optimized version)
cp tools/pre-commit-hook.sh .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
# Install post-commit hook (with loop prevention)
cp tools/post-commit-hook.sh .git/hooks/post-commit
chmod +x .git/hooks/post-commit
Benefits
✅ Automated version management
✅ Consistent workflow file generation
✅ Validation before commits
✅ Prevention of infinite loops
✅ Smart commit message parsing
✅ Artifact cleanup and optimization
Hook File Management
Active Hook Files (Currently Used)
- ✅
tools/pre-commit-hook.sh- ACTIVE (validation only) - ✅
tools/post-commit-hook.sh- ACTIVE (automation with loop prevention)
Installation Status
✅ Both hooks are installed and tested ✅ Legacy hook files have been removed ✅ Workflow automation is fully functional
Test Results (July 4, 2025)
✅ Pre-commit validation: Working
✅ Post-commit automation: Working
✅ Version bumping: Working (feat: 2.5.1 → 2.6.0)
✅ Auto-sync commits: Working
✅ Loop prevention: Working