Add protected-refs-policy with force-push blocking #58
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "agent/block-force-push"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Move the git hook policy engine from allod/secrets to tools. The script is a generic policy engine that reads config from ~/.config/git/ at runtime — no secrets in it. Config files stay in secrets.
New: detect non-fast-forward pushes via
git merge-base --is-ancestorand block them onagent/*branches andactive-pr-branchesentries. Overridable withALLOW_PROTECTED_REF=1.The verbatim copy from secrets includes
run_cdk_tracked_hook, which is hardcoded to$HOME/work/cdkandmisc/git-hooks/pre-commit. This doesn't belong in a generic tool but removing it here would mix concerns. #60 tracks replacing it with a generic.hookspathconvention that works with external projects without requiring them to change their layout.Follow-up: vnprc/secrets#36 to update
home-agent-hooks.nixto source the script from tools and delete the old copy.Ref: vnprc/parking-lot#35
Validation
5784570a95to1d47c25194