Repository navigation
chore(server): port upstream git, Windows and speed fixes (2026-10-08) - #263
Merged
Merged
Conversation
…14718) Ports upstream 447046b. Git subprocesses run with GIT_OPTIONAL_LOCKS=0 so `git status` stops taking index.lock to save a refreshed index, and the working tree numstat uses plumbing `git diff-index -M` (and `diff-files` on an unborn HEAD) because porcelain `git diff` rewrites the index regardless. Unborn HEAD detection now also recognises diff-index's "bad revision 'HEAD'". Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…usands of untracked files (pingdotgg#16771) Re-expresses upstream 10395bc for the fork. The fork's status refresh has no Changes totals, but its review diff spawned one `git diff --no-index` per untracked file (about 100ms each on Windows; 5,001 files ran past a minute). Untracked files are now added as intent-to-add entries to an empty temporary index and diffed in a single `git diff`, the same technique upstream uses, and upstream's 5,000-file cap reports the untracked diff truncated beyond that. The repository's real index is never touched. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ntrackedFiles=no (pingdotgg#15834) Ports upstream d9068d3. `git worktree remove` refuses to drop untracked files unless forced, but its check honors `status.showUntrackedFiles=no`, so it deleted them. Removal now runs with `-c status.showUntrackedFiles=normal`. Avi Code addition: the fork's worktree cleanup had the same hole. Its dirty flag came from `git status`, which hides those files, and the dialog pre-selects and the health monitor auto-removes "clean" dead worktrees by deleting the directory. The flag now comes from a new hasWorktreeChanges driver op that runs `git status --porcelain --untracked-files=normal`. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…nd (pingdotgg#14917) Ports upstream 4ce6a51. Git for Windows cannot create or delete paths past MAX_PATH unless core.longpaths is set, so deep worktrees failed to check out and failed midway through removal. On Windows every git subprocess now gets core.longpaths=true appended through GIT_CONFIG_COUNT/KEY/VALUE, preserving inherited entries and leaving argv and the user's config untouched. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Avi Code addition. When the cleanup dirty check failed, the worktree was treated as clean, so the dialog pre-selected it and the health monitor could auto-remove it. A failed check now reads as dirty. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
The fork has not merged upstream since 2026-07-30. This PR hand-ports four upstream git fixes onto the fork's
GitVcsDriverCore: index lock contention, Windows long paths, untracked-file CPU cost, and a worktree data-loss bug.Ported
GIT_OPTIONAL_LOCKS=0. Numstat now uses thediff-index -M/diff-filesplumbing commands. Unborn HEAD detection also recognises diff-index'sbad revision 'HEAD'.readUntrackedReviewDiffs, which spawned onegit diff --no-indexper untracked file: about 100ms each on Windows, and 5,001 files ran past a 60s timeout. Untracked files are now added as intent-to-add entries to an empty temporary index and diffed with a singlegit diff, the same technique upstream uses. Upstream's 5,000-file cap marks the untracked diff as truncated beyond that. The real index is never touched, and a test asserts this.status.showUntrackedFiles=no.git worktree removenow runs with-c status.showUntrackedFiles=normal. Avi Code addition: the fork's WorktreeCleanup had the same hole, in a worse form. ItsisDirtyflag came fromgit status, which hides those files. The cleanup dialog pre-selects "clean" dead worktrees, and the health monitor auto-removes them by deleting the directory outright.isDirtynow comes from a newhasWorktreeChangesdriver op that runsgit status --porcelain --untracked-files=normal.hasWorktreeChangesdirty check errors, the worktree is treated as dirty, so the health monitor never auto-removes it and the dialog does not pre-select it. Before, a failed check counted as clean. A test covers a failing check.core.longpaths=trueis appended to each git subprocess viaGIT_CONFIG_COUNT/KEY/VALUE, keeping any inherited entries.Skipped
Verification
vp test run(before the fail-closed commit) on GitVcsDriverCore, GitWorkflowService, WorktreeCleanup, WorktreeCleanupExecute, WorktreeHealthMonitor, ReviewService and VcsStatusBroadcaster tests: 101 passed, 1 failed. The failure ispreserves newline characters in worktree paths when listing refs, which also fails on unmodified origin/main on Windows because Windows cannot create a path containing a newline.bulk/; the hidden worktree file gets deleted.vp lintandvp fmt --checkpass on the changed files.tsgo --noEmit -p apps/server/tsconfig.jsonreports no errors.vp run check:avicodeandvp run test:avicode(7/7) pass.🤖 Generated with Claude Code