engineering-handbook/hooks/pre-push
Adam Moussa 896bfc7501
Some checks are pending
ci / ci / ci (push) Waiting to run
Merge pull request #28: docs: align engineering conventions for Cursor migration (PLAT-62)
docs: align engineering conventions for Cursor migration (PLAT-62)
2026-08-03 18:01:08 -04:00

18 lines
707 B
Bash
Executable file

#!/usr/bin/env bash
# pre-push shim for repos that set core.hooksPath.
#
# Setting core.hooksPath in a repo replaces the machine-global hooks directory
# entirely. Without this shim the workstation security pre-push gate is silently
# disabled. This file re-execs the global hook so the gate stays active.
#
# Install: used automatically when a repo's core.hooksPath points to a tracked
# hooks directory containing this file.
GLOBAL="${SH_GLOBAL_HOOKS:-$HOME/.config/git/hooks}/pre-push"
if [ ! -x "$GLOBAL" ]; then
echo "pre-push: global security hook is missing or not executable: $GLOBAL" >&2
echo "Repair the security-review hook installation before pushing." >&2
exit 1
fi
exec "$GLOBAL" "$@"