admin mr prune: drop MR head refs a history rewrite left pinning old commits #227

closed cmc opened this on 2026-09-18 02:39 UTC

Discussion

cmc 2026-09-18 02:39 UTC

A history rewrite leaves the removed commits reachable through refs/merge-requests/N/head of the MRs that landed them (krz/keycask: six heads, 35 commits main no longer reaches). The pre-receive hook refuses client deletes in that namespace and nothing server-side ever removes a head ref.

Following the GitHub model: nothing automatic on merge, close or rewrite. An instance admin names the MRs:

admin mr prune <owner/name> <n>... --yes

Refuses open and source_gone MRs (their head is what makes them mergeable), deletes the refs, runs git gc --prune=now on the repository, system comment per MR, audited. mr diff on a pruned head says so.

closed by cmc in commit a7c9352033: control: admin mr prune drops MR head refs and prunes the repository

2026-09-18 03:27 UTC

referenced in commit 6f5a52ae63 by cmc: wiki: offsite restic copies and the snapshot rewrite procedure

2026-09-18 04:00 UTC