fix(vcs): batch untracked diff checks#35997
Closed
HOYALIM wants to merge 1 commit into
Closed
Conversation
Signed-off-by: Ho Lim <subhoya@gmail.com>
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
This was referenced Jul 9, 2026
CreatorGhost
added a commit
to CreatorGhost/TheCode
that referenced
this pull request
Jul 12, 2026
Ported from upstream anomalyco#35997.
CreatorGhost
added a commit
to CreatorGhost/TheCode
that referenced
this pull request
Jul 12, 2026
Ported from upstream anomalyco#35997.
CreatorGhost
added a commit
to CreatorGhost/TheCode
that referenced
this pull request
Jul 12, 2026
* fix(vcs): batch untracked diff checks Ported from upstream anomalyco#35997. * fix(vcs): fail closed on intent-to-add error + test no-HEAD special filenames 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.
Author
|
Closing to reduce WIP and rework the scope. The temporary-index implementation expands the Git/VCS surface substantially and needs a benchmark plus stronger special-path, truncation, and cleanup coverage before review. |
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.
Issue for this PR
Closes #34916
Type of change
What does this PR do?
When a repository has no
HEAD, VCS diff collection handled each untracked file separately. This adds a batched untracked diff path using a temporary git index andgit add --intent-to-add --pathspec-from-file=- --pathspec-file-nul, then collects patch and numstat output in batches.Impact: no-
HEADuntracked diff collection moves from per-file git subprocesses to a fixed small number of git calls.How did you verify your code works?
bun test test/project/vcs.test.ts --timeout 30000frompackages/opencodebun typecheckfrompackages/opencodebun lint packages/opencode/src/project/vcs.ts packages/opencode/src/git/index.ts packages/opencode/test/project/vcs.test.tsgit diff --check HEAD~1..HEADScreenshots / recordings
N/A, non-UI change.
Checklist