Files
houseplan-card/.githooks/commit-msg
T
Matysh 9e74051652 Release v1.62.0-beta.8 candidate
Issue: #75
Issue: #76
Issue: #95
User-Visible: yes
2026-08-12 19:18:54 +03:00

32 lines
1.0 KiB
Bash

#!/bin/sh
set -eu
message_file=$1
# Git-generated merge commits do not represent an independently authored
# product change and inherit provenance from their parents.
case "$(basename "$message_file")" in
MERGE_MSG) exit 0 ;;
esac
if ! grep -Eq '^Issue: #[0-9]+[[:space:]]*$' "$message_file"; then
echo "House Plan: missing 'Issue: #<number>' trailer (see PROCESS.md)." >&2
exit 1
fi
if ! grep -Eq '^User-Visible: (yes|no)[[:space:]]*$' "$message_file"; then
echo "House Plan: missing 'User-Visible: yes|no' trailer (see PROCESS.md)." >&2
exit 1
fi
if git diff --cached --name-only --diff-filter=ACMR \
| grep -Eq '^demo/golden/baselines/.*\.(png|json)$'; then
if ! grep -Eq '^Release: [^[:space:]].*$' "$message_file"; then
echo "House Plan: a golden baseline commit requires a Release trailer." >&2
exit 1
fi
if ! grep -Eq '^Baseline-Reviewed: [^[:space:]].*$' "$message_file"; then
echo "House Plan: a golden baseline commit requires Baseline-Reviewed provenance." >&2
exit 1
fi
fi