Repository navigation
Clean up merged remote branches; fast remote branch list - #77
Merged
rocketraman merged 2 commits intoOct 29, 2026
Merged
Conversation
Each remote's heading in Remote branches gets "Clean up N merged", which deletes every merged (or squash-merged) branch shown for that remote, skipping integration branches. Unlike a single merged delete it asks first, listing the branches, since it deletes ones the click never named on a server others share. BranchOps.deleteRemotes does one ls-remote and a few chunked pushes per remote. Each delete is leased on the tip last fetched, so a branch pushed to since is skipped; one already deleted on the remote counts as deleted and its stale copy is dropped. Popup.Confirm gains an optional details list to show the names, as the message is capped at three lines. Signed-off-by: Raman Gupta <rocketraman@gmail.com>
…loading On a repo with ~250 remote branches the list took ~22s to appear, showing "No remote branches" meanwhile. It now shows "Loading…", and loads in ~1.7s cold and ~25ms when returning to the repo. Nearly all the time was the squash-merge check, and within it the pathspec on `git log -p <base>..<mainline> -- <branch's files>`: git matches every pathspec against every commit walked, 5-7s for one branch of a few thousand files. Candidates now come from a pathspec-free --name-only log (commits touching all of the branch's files) and only those are diffed. Answers are identical on all 249 branches checked. Also: results are cached by (branch tip, mainline tip), the ancestry test is one for-each-ref --merged instead of a process per branch, and branches are tested six at a time. Reopening the section mid-load no longer starts a second load, and leaving the repo cancels it. Signed-off-by: Raman Gupta <rocketraman@gmail.com>
rocketraman
force-pushed
the
claude/cleanup-merged-remote-branches-276d52
branch
from
October 29, 2026 18:42
5503c77 to
412f94c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clean up merged remote branches
Each remote's heading in Remote branches gets Clean up N merged. It deletes every merged branch shown for that remote, including squash-merged ones, and skips integration branches. A confirmation lists the branches first.
ls-remoteplus chunked pushes per remote, not a push per branch.Remote branch list: loading indicator and speed
On a repo with ~250 remote branches the list took ~22s to appear and showed "No remote branches" until then. It now shows Loading…, and takes ~1.7s cold and ~25ms when you come back to the repo.
git log -p … -- <every file the branch changed>. git matches each pathspec against every commit it walks, which took 5–7s for a single branch of a few thousand files; the same log with no pathspec takes 40ms. Candidate commits now come from a--name-onlylog with no pathspec, and only those few are diffed. Results matched the old algorithm on all 249 branches of the test repo.for-each-ref --merged, not one process per branch.Testing
BranchOps.deleteRemotestests: a normal batch, a branch pushed to since the fetch, one already gone on the remote, and one the server refuses.