#!/bin/sh
# Check the commit message before it becomes permanent.
#
# Activated by the same setting as the pre-commit hook:
#     git config core.hooksPath .githooks
#
# A message is the one published surface that can never be corrected.
#
# **This file used to claim it ran the hygiene rules over the message, and it did
# not.** It ran only `commit_msg_check.py`, which checks the subject length and
# insists a three-digit number carries a measurement basis -- both worth having,
# neither about publication. So the comment described the property that would have
# stopped an internal repository nickname reaching four public commit messages,
# while the code did something else entirely. Nothing checked the claim, because it
# was a claim in a comment.
#
# This runs the publication vocabulary over the message: must this text never be
# published? It is the one surface that cannot be undone after a push.
#
# To commit past it knowingly:   git commit --no-verify
# Note that --no-verify also disables the pre-commit hygiene sweep.
set -e
ROOT="$(git rev-parse --show-toplevel)"

exec python3 "$ROOT/tools/hygiene_check.py" --message "$1"
