feat(worktrees): periodic background git fetch --all across all repos - #154
Draft
big-guy wants to merge 2 commits into
Draft
feat(worktrees): periodic background git fetch --all across all repos#154big-guy wants to merge 2 commits into
git fetch --all across all repos#154big-guy wants to merge 2 commits into
Conversation
Adds a FetchPoller that runs `git fetch --all` on every known repo every 3 minutes so worktrees stay current with their remotes without a manual fetch. The timer always runs; each tick no-ops when disabled or while a prior sweep is still in flight. A boot sweep fires once at startup, and re-enabling the setting fetches immediately rather than waiting for the next tick. Per-repo failures (offline/auth) are swallowed so one bad remote doesn't stop the others. Adds an `autoFetchEnabled` setting (default on) with a toggle under Settings → Worktrees to disable it for all repos. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tions Places the "Auto-fetch remotes" toggle directly beneath the "Branch from the latest remote main" radio group (both are remote-related, global-only settings) instead of next to the Claude-permissions sharing toggle. Also drops a redundant enabled-check in the setAutoFetchEnabled IPC handler — fetchAll() already no-ops while disabled. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
What
Adds a background task that runs
git fetch --allon every known repo every 3 minutes, so worktrees stay current with their remotes without a manual fetch. Includes a Settings toggle to disable it for all repos.How
FetchPoller(src/main/fetch-poller.ts) — new poller modeled onPRPoller. Fires every 3 min, fetching all repo roots in parallel. No-ops while disabled or while a prior sweep is still in flight; per-repo failures (offline/auth) are swallowed so one bad remote doesn't stop the others.fetchAllRemotes(repoRoot)(src/main/worktree.ts) — thingit fetch --all --quietprimitive living with the other git helpers, with a[git-op]perf-log line.src/main/index.ts) — constructs + starts the poller at boot with one immediate sweep, plus aconfig:setAutoFetchEnabledIPC handler that persists the flag and fetches immediately on re-enable.autoFetchEnabledsetting (default on) threaded through the slice → persistence → build-initial-state → backend → types, with a toggle under Settings → Worktrees, directly beneath the "Branch from the latest remote main" options.Testing
npm run typecheck✅npx electron-vite build✅npx vitest run✅ (1511 tests; added a reducer test for the new event)🤖 Generated with Claude Code