#!/usr/bin/env bash # Chain the ops-log attribution hook onto .git/hooks/post-commit. # # APPENDS rather than replaces: graphify already owns that file, and # core.hooksPath would disable it. Idempotent — safe to re-run. set -euo pipefail REPO="$(git rev-parse --show-toplevel)" HOOK="$REPO/.git/hooks/post-commit" if [ ! -f "$HOOK" ]; then printf '#!/bin/sh\n' > "$HOOK"; chmod +x "$HOOK" fi if grep -q "post-commit-ops-log" "$HOOK"; then echo "already installed"; exit 0 fi printf '\n# ops-log attribution hook (scripts/git-hooks/post-commit-ops-log)\n"$(git rev-parse --show-toplevel)/scripts/git-hooks/post-commit-ops-log" || true\n' >> "$HOOK" echo "installed — commits now record their althing handle to the ops log"