Skip to content
Shell
593 B
Raw Blame
#!/bin/bash
# Post-Commit Hook: Confirmation Feedback
# Provides clear feedback after successful commits

# Get the last commit message
COMMIT_MSG=$(git log -1 --pretty=%B)

# Extract first line for concise output
FIRST_LINE=$(echo "$COMMIT_MSG" | head -n 1)

echo ""
echo "βœ… Migration committed successfully!"
echo "πŸ“ Commit: $FIRST_LINE"
echo ""

# Count total commits in this branch
BRANCH=$(git rev-parse --abbrev-ref HEAD)
COMMIT_COUNT=$(git rev-list --count HEAD ^main 2>/dev/null || echo "1")

echo "πŸ“Š Branch: $BRANCH"
echo "πŸ“ˆ Total commits in branch: $COMMIT_COUNT"
echo ""