setup-commit-template.shā¢1.68 kB
#!/bin/bash
# Setup script for commit templates and git hooks
echo "š Setting up commit templates and hooks for it-tools-mcp..."
# Set up commit template
echo "š Configuring git commit template..."
git config commit.template .gitmessage
echo "ā
Commit template configured (use 'git commit' without -m to see template)"
# Set up git hooks (optional)
read -p "šŖ Do you want to install git hooks (commit validation + auto-versioning)? (y/n): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
echo "š Setting up git hooks directory..."
git config core.hooksPath .githooks
chmod +x .githooks/*
echo "ā
Git hooks installed (commit-msg validation, auto-versioning)"
git config core.hooksPath .githooks
echo "ā
Git hooks configured"
echo " - Commit messages will be validated against conventional commit format"
echo " - Invalid commits will be rejected with helpful error messages"
else
echo "āļø Skipping git hooks setup"
fi
echo ""
echo "š Setup complete!"
echo ""
echo "š Usage:"
echo " ⢠Use 'git commit' (without -m) to see the template"
echo " ⢠Use conventional commit format: 'type: description'"
echo " ⢠See COMMIT_TEMPLATE_SETUP.md for detailed examples"
echo ""
echo "š Version bumping:"
echo " ⢠feat: ā minor version bump"
echo " ⢠fix: ā patch version bump"
echo " ⢠BREAKING CHANGE: ā major version bump"
echo " ⢠Others ā patch version bump"
echo ""
echo "Example commits:"
echo " git commit -m 'feat: add new hash generator tool'"
echo " git commit -m 'fix: resolve encoding issue in base64'"
echo " git commit -m 'feat!: restructure API (breaking change)'"
echo ""