Skip to content

Coalesce status refreshes by remote#1940

Merged
juliusmarminge merged 1 commit intomainfrom
t3code/7b913836
Apr 12, 2026
Merged

Coalesce status refreshes by remote#1940
juliusmarminge merged 1 commit intomainfrom
t3code/7b913836

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented Apr 12, 2026

Summary

  • Change status upstream refresh caching to key off gitCommonDir and remote name instead of the full upstream ref details.
  • Simplify the status refresh fetch to use git fetch --quiet --no-tags <remote> for sibling worktrees on the same remote.
  • Update integration coverage for shared refreshes and failed-refresh backoff across worktrees, and adjust the fetch expectation accordingly.

Testing

  • bun fmt
  • bun lint
  • bun typecheck
  • bun run test

Note

Medium Risk
Changes the statusDetails upstream 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 statusDetails refresh 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

  • Changes the status refresh cache key from (gitCommonDir, upstreamRef, upstreamBranch) to (gitCommonDir, remoteName) in GitCore.ts, so all branches sharing the same remote and common dir share a single fetch entry.
  • Replaces the branch-specific refspec fetch with a broad git fetch --quiet --no-tags <remote> call, fetching all refs from the remote at once.
  • Behavioral Change: worktrees on the same remote now trigger at most one fetch per TTL window instead of one per tracked branch; this reduces fetch frequency but means a branch-specific fetch is no longer issued.

Macroscope summarized 17dfc2e.

- 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>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6e69c334-cdb5-4726-a960-bd7f4ceaee22

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/7b913836

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Apr 12, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 12, 2026

Approvability

Verdict: 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.

@juliusmarminge juliusmarminge merged commit f9019cd into main Apr 12, 2026
12 checks passed
@juliusmarminge juliusmarminge deleted the t3code/7b913836 branch April 12, 2026 01:51
spadaval pushed a commit to spadaval/t3code that referenced this pull request Apr 12, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant