ux(prune): dry-run lists fewer branches than --remote deletes, and a second run is needed to clear stale tracking refs (with raw git output leaking through) #63
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea#63
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Live transcript (2026-07-14, CLI, specifics masked), four consecutive runs in one repo:
Problem 1 — the consent set doesn't match the executed set
The dry run listed 20 merged branches;
--yes --remotethen deleted 22 remote branches. The two extras were remote-only merged branches (no local counterpart), which the preview never enumerated. For a destructive operation, the confirm step must show exactly what will be deleted: a user who reads 20 names and confirms has not consented to 22 deletions. The dry run should list the remote-only merged branches too (or at minimum, split the preview into "local" and "remote-only" sections when the remote could be affected), and the hint line should say that--remotewidens the set beyond what's listed.Problem 2 — the deleting run leaves stale remote-tracking refs behind
After
--yes --remotedeleted the remote branches, the local remote-tracking refs (origin/<branch>) stayed behind; it took a third invocation to prune 22 stale tracking refs. The run that deletes remote branches knows exactly which refs it just made stale — it should prune them in the same invocation and leave a clean state, not hand the user a follow-up chore they only discover by re-running.Problem 3 — raw git output leaks through on the cleanup pass
That third run printed git's raw
fetch --pruneoutput verbatim (theFrom https://…header and per-ref- [deleted] (none) -> origin/…lines) followed by madtea's own summary line — duplicated information in two voices. Every other prune mode prints madtea-formatted output only. The raw passthrough should be captured and summarized (or shown only under a verbose flag), consistent with the rest of the surface. (Related but opposite polarity to the existing "not as verbose as git pull" report — the shared ask is deliberate, consistent output discipline for wrapped git operations.)Acceptance
confirm=true remote=truerun would delete, local and remote-only, with counts that match the deletion report exactly.--remotedeletion prunes the now-stale remote-tracking refs in the same run; an immediate re-run prints "nothing to prune".madt_prunechecked for the same three behaviors (the transcript is CLI; the tool surface shares the implementation).