#!/bin/sh
# Validate the commit message against the Conventional Commit format.
# Delegates to scripts/commit_msg_hook.py (logic is unit-tested in tests/release).
# Installed via: python scripts/setup_hooks.py  (sets core.hooksPath -> .githooks)

hook_dir=$(dirname "$0")
script="$hook_dir/../scripts/commit_msg_hook.py"

for py in python python3 py; do
    if command -v "$py" >/dev/null 2>&1; then
        exec "$py" "$script" "$1"
    fi
done

echo "commit-msg hook: no python interpreter found on PATH; skipping validation" >&2
exit 0
