fix(vcs): batch untracked diff checks#15
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds a Git API for batching untracked patches and statistics through a temporary index. The VCS layer uses these batches for repositories without a HEAD, with tests covering call sequencing, per-file metadata, and special filenames. ChangesUntracked diff batching
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant VcsTrack
participant GitStatus
participant GitDiffUntracked
participant GitRepository
VcsTrack->>GitStatus: inspect repository status
GitStatus-->>VcsTrack: untracked files
VcsTrack->>GitRepository: check HEAD
GitRepository-->>VcsTrack: no HEAD
VcsTrack->>GitDiffUntracked: batch untracked files
GitDiffUntracked-->>VcsTrack: patch and statistics
VcsTrack-->>GitRepository: construct per-file diff output
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
b8b75fd to
730aa43
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
Ported from upstream anomalyco#35997.
…ilenames Addresses Opus review of PR #15: guard diffUntracked against a failed intent-to-add (return empty batch so caller falls back to per-file native patches) and add a no-HEAD untracked test exercising NUL-pathspec escaping.
730aa43 to
53e9832
Compare
Port of upstream anomalyco/opencode#35997.
Adds
diffUntracked()using a temporary git index so untracked-file diffs are computed in one batched git invocation instead of per-file spawns — a large speedup for repos with many untracked files and for no-HEAD (freshly-initialized) repos.Verified:
bun test test/project/vcs.test.ts(14 pass) andbun typecheckfrom packages/opencode. Applied cleanly.Summary by CodeRabbit
New Features
Bug Fixes