Skip to content

feat(graph): fetch from the remote when the commit graph opens - #103

Merged
atman-33 merged 1 commit into
mainfrom
feature/graph-auto-fetch
Aug 9, 2026
Merged

feat(graph): fetch from the remote when the commit graph opens#103
atman-33 merged 1 commit into
mainfrom
feature/graph-auto-fetch

Conversation

@atman-33

@atman-33 atman-33 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

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

  • The graph runs git fetch --prune in the background when it opens.
  • The fetch starts beside the initial git log, not before it: the log is
    local and instant, the fetch is network-bound, so the graph paints
    immediately and refreshes once the fetch returns.
  • It deliberately bypasses runOp. runOp sets opBusy, which would disable
    the entire header while a job the user never asked for is running, and would
    surface its failure as an operation error.
  • A repository is auto-fetched at most once a minute; a manual Fetch/Pull
    starts the same cooldown, so closing and reopening the sheet does not spam
    the remote.
  • A fetch that cannot run (no remote configured, offline, credentials needed)
    is swallowed and leaves a single quiet line in the status bar — no dialog.
  • While it runs, the header shows a spinner and Fetching…; all buttons stay
    usable.

Scope deliberately excludes an on/off setting and periodic polling while the
graph is open.

Verification

  • npm run build (typecheck + build) — pass
  • npm test — 195 tests pass
  • cargo 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

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>
@atman-33
atman-33 merged commit 65dd38e into main Aug 9, 2026
1 check passed
@atman-33
atman-33 deleted the feature/graph-auto-fetch branch August 9, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant