# Check if commit message is empty (rebase, merge, etc.)
if [ -z "$(head -n1 "$1")" ]; then
    exit 0
fi

# Add conventional commit template if message is empty
if [ "$(head -n1 "$1")" = "" ]; then
    echo "# Conventional Commits Guide:
# Types: feat, fix, docs, style, refactor, test, chore
# Format: type(scope): description
# Example: feat(auth): add JWT token validation
#
# Please write your commit message above this line" > "$1"
fi
