Skip to content

Speed up review branch picker via for-each-ref#31464

Merged
charliemarsh-oai merged 2 commits into
mainfrom
charlie/faster-review-branch-picker
Jul 8, 2026
Merged

Speed up review branch picker via for-each-ref#31464
charliemarsh-oai merged 2 commits into
mainfrom
charlie/faster-review-branch-picker

Conversation

@charliemarsh-oai

@charliemarsh-oai charliemarsh-oai commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Opening /review and choosing a branch currently enumerates branches through git branch, which performs broader branch presentation work. In a large repo, it isn't hard for this to timeout completely.

This PR instead uses git for-each-ref scoped directly to refs/heads so the picker reads only local branch refs. It preserves the existing sorting and default-branch promotion while excluding remote-tracking refs and detached-HEAD display rows.

@charliemarsh-oai charliemarsh-oai requested a review from jif-oai July 7, 2026 21:09
@charliemarsh-oai charliemarsh-oai force-pushed the charlie/faster-review-branch-picker branch from d474f34 to 170554a Compare July 7, 2026 21:23
@charliemarsh-oai charliemarsh-oai changed the title Speed up review branch picker Speed up review branch picker via for-each-ref Jul 7, 2026
local_git_branches(repo).await,
vec!["main".to_string(), "feature/local".to_string()]
);
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incidentally, on main, if you're in a detached HEAD, we show (detached HEAD) -> (HEAD detached at abc123). That's now omitted.

@charliemarsh-oai charliemarsh-oai marked this pull request as ready for review July 7, 2026 21:30
@charliemarsh-oai charliemarsh-oai requested review from anp-oai and removed request for jif-oai July 7, 2026 21:44
@charliemarsh-oai charliemarsh-oai merged commit 49f5cb0 into main Jul 8, 2026
35 checks passed
@charliemarsh-oai charliemarsh-oai deleted the charlie/faster-review-branch-picker branch July 8, 2026 00:01
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants