Coalesce status refreshes by remote#1940
Conversation
- Refresh the shared remote once per git common dir - Keep the brief failure cooldown for sibling worktrees - Update tests for same-remote worktree behavior Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved This PR refactors the git status refresh caching to coalesce fetches by remote instead of by specific upstream ref, an internal optimization. Changes are focused, well-tested with updated test cases, and don't touch sensitive areas. You can customize Macroscope's approvability policy. Learn more. |
Co-authored-by: codex <codex@users.noreply.github.com>
Summary
gitCommonDirand remote name instead of the full upstream ref details.git fetch --quiet --no-tags <remote>for sibling worktrees on the same remote.Testing
bun fmtbun lintbun typecheckbun run testNote
Medium Risk
Changes the
statusDetailsupstream refresh cache key and fetch strategy, which can alter when/what refs get updated and may affect status accuracy or fetch load across worktrees/remotes.Overview
Coalesces
statusDetailsrefresh work across worktrees by remote. The upstream-refresh cache key is simplified from(gitCommonDir, upstreamRef/branch)to(gitCommonDir, remoteName), so sibling worktrees tracking different branches on the same remote share a single refresh and failure backoff window.Simplifies refresh fetching. Status refresh now runs
git fetch --quiet --no-tags <remote>(instead of fetching a specific upstream refspec), and tests are updated to assert the new fetch args and to cover coalescing/backoff when worktrees have different upstream refs on the same remote.Reviewed by Cursor Bugbot for commit 17dfc2e. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Coalesce git status remote refreshes by remote name instead of per-branch
(gitCommonDir, upstreamRef, upstreamBranch)to(gitCommonDir, remoteName)inGitCore.ts, so all branches sharing the same remote and common dir share a single fetch entry.git fetch --quiet --no-tags <remote>call, fetching all refs from the remote at once.Macroscope summarized 17dfc2e.