-
Notifications
You must be signed in to change notification settings - Fork 229
Expand file tree
/
Copy pathpost-commit
More file actions
executable file
·23 lines (21 loc) · 919 Bytes
/
post-commit
File metadata and controls
executable file
·23 lines (21 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
# Check if required hooks are installed
if [ ! -f ".git/hooks/commit-msg" ] || [ ! -x ".git/hooks/commit-msg" ]; then
echo "============================================================"
echo "⚠️ Note: Git hooks for checking commit messages are not installed."
echo "Please run the following commands to install:"
echo ""
echo " 1. Install pre-commit:"
echo " pip install pre-commit"
echo ""
echo " 2. Install hooks:"
echo " .git-hooks/install-hooks.sh"
echo ""
echo "These hooks will help detect sensitive information leaks and"
echo "Chinese characters in commit messages."
echo "============================================================"
fi
# Ensure the hook itself is executable
if [ -f ".git-hooks/check-commit-message.sh" ] && [ ! -x ".git-hooks/check-commit-message.sh" ]; then
chmod +x .git-hooks/check-commit-message.sh
fi