fix(server): reuse Git index metadata during checkpoint capture - #10792
fix(server): reuse Git index metadata during checkpoint capture#10792im-kvijay wants to merge 1 commit into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — The change is a localized checkpoint-capture optimization with explicit fallback to the existing behavior and broad tests for Git index variants, filters, and scoped captures. It does not add a user-facing capability, alter schemas or defaults, or affect deployment, security, billing, or authentication. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthrough
ChangesCheckpoint capture
Priority: ➖ Normal — Schedule the Git checkpoint performance change because it reduces capture time in large repositories while preserving snapshot contents and workspace index state. Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Checkpoint capture should become faster while preserving snapshot contents and the workspace index; the supplied validation shows no actionable merge-blocking risk. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
What Changed
Checkpoint capture now seeds its private index from the workspace index and resets it to HEAD while retaining matching file metadata. The existing
git add -A -- .then avoids rereading unchanged tracked files. The workspace index stays untouched.Discard filesystem-monitor state during the reset. Fall back to the existing fresh-index path if copying or inspection fails, inspection is truncated, or assume-unchanged/skip-worktree flags remain.
Why
Starting with a fresh index throws away Git's stat cache on every capture. Reusing it reduces unnecessary work in large repositories while preserving scoped staging and snapshot contents.
Related to #3646; independent of the failed-write cleanup in #9809. Builds on the index-reuse approach explored in #8538, with a fresh-index fallback instead of normalizing special flags. Unlike #8301, this keeps native
add -Astaging rather than parsing changed paths. Discussion: #9808 (comment).Validation
061543e9e.The 30-second timeout is unchanged. Large new or modified files still need hashing; this does not claim to resolve every timeout in #3646.
Checklist
Implemented and verified with GPT-6 Astra through the Codex harness.
Summary by CodeRabbit