Skip to content

Optimize track_branches to avoid git checkout operation#773

Merged
cottsay merged 1 commit into
masterfrom
cottsay/git-track-optimization
May 1, 2026
Merged

Optimize track_branches to avoid git checkout operation#773
cottsay merged 1 commit into
masterfrom
cottsay/git-track-optimization

Conversation

@cottsay

@cottsay cottsay commented May 1, 2026

Copy link
Copy Markdown
Member

The track_branches operation is currently using a call to git checkout to set up the local branchs and track the proper remote. This means that we're actually updating the files on disk every time, which isn't necessary to establish the branch. Using a direct call to git branch is a LOT faster.

Gemini 3 was used to help rewrite this function.

This appears to be roughly 10% faster when blooming large repositories even on a ramdisk. The savings would theoretically be far greater when running on an actual disk.

The track_branches operation is currently using a call to `git checkout`
to set up the local branchs and track the proper remote. This means that
we're actually updating the files on disk every time, which isn't
necessary to establish the branch. Using a direct call to `git branch`
is a LOT faster.

Gemini 3 was used to help rewrite this function.
@cottsay cottsay requested a review from claraberendsen May 1, 2026 18:50
@cottsay cottsay self-assigned this May 1, 2026
@cottsay cottsay merged commit 915f783 into master May 1, 2026
17 checks passed
@cottsay cottsay deleted the cottsay/git-track-optimization branch May 1, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants