#!/bin/bash
# Git commit-msg hook (enable with: bash scripts/dev/install-git-hooks.sh).
#
# scripts/dev/check-commit-credit.py: a commit made as the owner's noreply
# identity carries no AI author and no AI Co-authored-by trailer (AGENTS.md,
# "Owner's commit credit"). Other committers pass untouched. Fails open when
# python3 or the script is missing. Skip once with `git commit --no-verify`.

root="$(git rev-parse --show-toplevel 2>/dev/null)" || exit 0
script="$root/scripts/dev/check-commit-credit.py"
[ -f "$script" ] || exit 0
command -v python3 >/dev/null 2>&1 || exit 0
exec python3 "$script" --message-file "$1"
