feat(graph): fetch from the remote when the commit graph opens - #103
Merged
Conversation
Opening a repository's commit graph showed whatever remote refs happened to be in the local repo, so remote branches and tags were stale until Fetch was pressed by hand. The graph now runs `git fetch --prune` in the background on open. It starts beside the initial `git log` rather than before it, so the local log still paints instantly and the graph refreshes only once the fetch returns. The job deliberately bypasses `runOp`: that sets `opBusy`, which would disable the whole header while a job the user did not ask for runs, and would report its failure as an operation error. A repository is auto-fetched at most once a minute (a manual fetch/pull starts the same cooldown), and a fetch that cannot run — no remote, offline, credentials needed — leaves one quiet line in the status bar. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Why
Opening a repository's commit graph rendered whatever remote refs happened to
be in the local repo. Remote branches and tags stayed stale until Fetch was
pressed by hand, which is easy to forget and makes the graph quietly misleading.
What
git fetch --prunein the background when it opens.git log, not before it: the log islocal and instant, the fetch is network-bound, so the graph paints
immediately and refreshes once the fetch returns.
runOp.runOpsetsopBusy, which would disablethe entire header while a job the user never asked for is running, and would
surface its failure as an operation error.
starts the same cooldown, so closing and reopening the sheet does not spam
the remote.
is swallowed and leaves a single quiet line in the status bar — no dialog.
Fetching…; all buttons stayusable.
Scope deliberately excludes an on/off setting and periodic polling while the
graph is open.
Verification
npm run build(typecheck + build) — passnpm test— 195 tests passcargo fmt --check,cargo clippy --release --all-targets -- -D warnings,cargo test --release— pass (no Rust changes beyond the version bump)Version bumped to 0.72.0 with a CHANGELOG entry.
Task: T-0141
🤖 Generated with Claude Code