Expand description
Local-branch hygiene after squash merges.
A squash merge rewrites the branch’s work into one trunk commit, so the
branch tip never becomes an ancestor of the trunk and git’s own
--merged test cannot see the merge. Once the forge deletes the remote
branch and a pruning fetch drops the tracking ref, [gone] is the one
local signal left — and it proves only that the upstream vanished,
never that it merged. This module holds the pure half of rk branches prune: parsing what git for-each-ref reports, the guard order that
keeps a branch out of the candidate set, and the confirmation predicate
that turns a forge answer into proof. Spawning stays in the handler.
Structs§
- Branch
- One local branch, as
git for-each-refreports it.
Enums§
- Class
- What the report says about one gone branch.
Constants§
- FOR_
EACH_ REF_ FORMAT - The
--formatstring the handler passes togit for-each-ref, one tab-separated line per local branch. - PROTECTED_
PREFIX - The prefix naming a release line; a branch under it is never a candidate, whatever its upstream says.
Functions§
- classify
- Classify one branch:
Nonewhen its upstream is live or unset — the branch never reaches the report — and the guard’s verdict otherwise. - confirmation
- Judge one forge answer against one tip: only a merged request whose recorded head equals the local tip confirms, because a squash merge destroys the ancestry every other proof would rest on.
- merged_
request_ for - Ask the forge for the requests carrying one commit and judge the answer.
- parse_
branches - Parse the tab-separated
for-each-refoutput into branches, skipping any line that does not carry all five fields.