PRD 0028: git-gate new-branch push scan scope #107
Reference in New Issue
Block a user
Delete Branch "prd-0028-git-gate-new-branch-scan"
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?
Closes #106.
Tracking PR for PRD 0028. Implementation follows on this branch.
Summary
git-gate's pre-receive scans the entire ancestry of a new branch, so the repo's 11 historical test-fixture/demo findings reject every new-branch push (diagnosed live in #106 — presents as a silent hang). Scope the new-ref scan to the commits the push introduces (
$new --not --all), with a security argument that this loses no coverage, and harden the forwardsshagainst hangs.Why scoping is safe
Commits enter the gate's bare repo only via (1) mirror-fetch from the trusted upstream or (2) a gitleaks-scanned push. So any commit excluded by
--not --allis already-upstream or already-scanned — it can't be a new secret reaching the upstream via this push. The only commits that can introduce a new secret are the ones the push adds, which is exactly what$new --not --allscans. (Full argument in the PRD + issue #106 thread.)Plan
$new --not --all;ssh_cmd+=BatchMode=yes+ConnectTimeout. Unit tests.