Files
dolibarr/dev/setup/git/hooks/msg-commit
ldestailleur 333e977bf9 Allowed commit
2025-09-17 23:25:33 +02:00

13 lines
331 B
Bash
Executable File

#!/bin/sh
# Hook to force a prefix on commits
commit_msg_file=$1
first_line=$(head -n1 "$commit_msg_file")
if echo "$first_line" | grep -Eqi '^(QUAL|SEC|PERF|FIX|CLOSE|NEW|Clean code|Debug[CSS)'; then
exit 0
else
echo "The commit message must start with QUAL, SEC, PERF, FIX, CLOSE, NEW, Clean code, Debug, CSS ..."
exit 1
fi