Repository navigation
feat(wsl): run Git for Windows for a WSL project on a Windows drive (D1c-2) - #33090
Conversation
da5e00e to
23beeb2
Compare
4744e59 to
ae05cd2
Compare
23beeb2 to
c77bc34
Compare
ae05cd2 to
2f43ad5
Compare
c77bc34 to
e7aacf8
Compare
2f43ad5 to
7a5ca94
Compare
e7aacf8 to
9468359
Compare
7a5ca94 to
73563e1
Compare
9468359 to
cddc92b
Compare
bd03615 to
5f403b6
Compare
40089d1 to
233d2eb
Compare
5f403b6 to
9f1aaf2
Compare
233d2eb to
e3f0ef2
Compare
9f1aaf2 to
4d04511
Compare
e3f0ef2 to
7d37d79
Compare
090d7be to
e511133
Compare
7d37d79 to
2d26087
Compare
767b00d to
ab406c7
Compare
ab406c7 to
d19fc7b
Compare
a4b8ff3 to
4b8ab7c
Compare
d19fc7b to
7149b9f
Compare
4b8ab7c to
244d317
Compare
7149b9f to
a476da8
Compare
244d317 to
b51d42f
Compare
6706826 to
695780a
Compare
|
STATUS: all re-review fixes are pushed. The stack is rebased onto main Heads (CI just started on all of them):
For reviewer A:
Reviewer B's items:
Checks: each branch passed the full load rule, run one branch at a time on this head: Open: in the previous run, |
|
No actionable comments were generated in the recent review.
|
|
STATUS: CI is green on every head in the stack (finished 12:32 UTC). Base is main
The |
A project on C:\ whose runtime is WSL ran every Orca Git command through wsl.exe on /mnt/c: ~300x slower than Windows Git, and blind to Windows-side edits. The project's WSL runtime preference gains an optional `git: 'windows-host'`. With it, Orca's Git (and where new worktrees go) is Windows; terminals, agents, accounts and hooks still resolve to WSL, so nothing else changes. Older builds drop the field and go back to WSL Git. The conversion checks first, then the caller saves the returned preference through the normal project update: - Git for Windows must exist. - New worktrees must not be set to go inside the distro. - No linked worktree may have a Linux-path link. WSL Git made those; Windows Git sees them as prunable, and Orca's prune after a worktree removal would delete their metadata. - Optionally writes core.autocrlf=true into the repo when Windows Git uses it, so WSL Git in the project's terminals stops seeing CRLF changes. Never core.checkStat. IPC is refused off Windows and with the internal WSL hosts gate closed. Co-Authored-By: Claude <[email protected]>
…n test Co-Authored-By: Claude <[email protected]>
…it, and record which Git ran
…e the project's runtime does
…th WSL hosts on These reads ran host Git on main. Routing them into a WSL-runtime project's distro is part of D1c, so with the WSL hosts gate closed they run host Git exactly as before. (cherry picked from commit 2ed82987dc5b82c3a86ea7e03ce05e9efc3e77fb)
…core registration under its line cap The optional commit-message resolvers pass straight through, so the call is the same with or without them. #34059 left this file at the 300-line cap and the WSL drive-project wiring adds to it. Co-Authored-By: Claude <[email protected]>
…ee links with the prune guard's reader
Folder repos run no Git, so rev-parse on them always failed the preview. The link reader and
the WSL-authored test now come from worktree-prune-guard.ts; the copy's startsWith('/') wrongly
refused //wsl.localhost links, which Windows Git writes itself.
Co-Authored-By: Claude <[email protected]>
…'s Git runs in, so it never boots a stopped one
695780a to
5b29bb3
Compare
|
STATUS: the whole D1c stack is restacked onto main Conflicts: none, so nothing was resolved by hand. Range-diff shows every commit identical to its previous version, and each PR's diff matches its previous diff line for line.
Checks: each PR passed the full load rule on its new head, run one at a time: Changed in a PR body: #33531's Flag-off line said the new |
[Medium impact] The change affects Git and worktree workflows for opted-in Windows-drive projects. The PR appears safe to merge with the verified routing changes in PR #33531; two non-blocking conversion checks should be tightened. FindingsSummaryAdds
|
| if (repo.worktreeBasePath && isWslUncPath(repo.worktreeBasePath)) { | ||
| preview.blockers.push({ kind: 'worktree-folder-in-distro', repoId: repo.id }) | ||
| } |
There was a problem hiding this comment.
Inherited WSL folders escape checks
The folder check only reads repo.worktreeBasePath. If a repo has no override and the global workspaceDir points into WSL, conversion succeeds but new worktrees still go into that distro. Windows Git then crosses the slow Windows-to-WSL file connection instead of staying on the Windows drive. Check the effective worktree folder, including the global fallback, before allowing conversion.
Knowledge Base Used: Workspace and worktree lifecycle
| export async function readWorktreeLinks(commonDir: string): Promise<string[]> { | ||
| return (await readWorktreeAdminLinks(join(commonDir, 'worktrees'))).map(({ link }) => link) |
There was a problem hiding this comment.
Failed reads pass safety checks
readWorktreeLinks uses a reader that turns every folder-read error into an empty list and skips unreadable gitdir files. If a permission or temporary file error occurs, conversion can succeed without checking whether existing worktrees are compatible. Use a strict reader here: allow a missing worktree folder, but stop conversion on other read failures.
Knowledge Base Used: Workspace and worktree lifecycle
ELI5
Some Windows projects live on
C:\but are set to run in WSL. For those, Orca currently runs every Git command through WSL on the Windows drive, which is about 300 times slower than Git for Windows and misses changes made from Windows. This PR adds a switch for such a project: Orca uses Git for Windows, and its terminals and agents keep running in WSL.What Changed
git: 'windows-host'(src/shared/project-execution-runtime.ts). With it set:src/main/project-runtime-git-options.ts).src/main/wsl/wsl-drive-project-windows-git.tschecks the project, then hands back the runtime setting to save. The caller saves it through the normal project update, so the window and the move fence see it. It refuses when:/mnt/c/…or/home/…. Git for Windows can't read those links. It lists those worktrees as prunable, and thegit worktree pruneOrca runs after removing any worktree would delete their Git data. The check reads the link files directly, because Git for Windows may print a Linux path as a path under the current drive.core.autocrlf=trueand the repo doesn't set it, the conversion can writecore.autocrlf=trueinto the repo, so plaingitin WSL terminals stops showing every file as modified. It never writescore.checkStat, because that hides same-size edits from Windows Git.getProjectRuntimeReadGitOptionsinproject-runtime-git-options.ts). With the gate closed they run host Git, as on main.wslDriveProject:previewandwslDriveProject:convert. Both are refused off Windows and while the internal WSL hosts gate is closed. The settings UI comes in the next PR.Why
Linked Issue
Part of the WSL re-write, step D1c (risk rows R36, R37, R6). Stacked on #33085.
Visual Proof
N/A: no UI in this PR (the settings row is in the next PR).
Testing
wsl-drive-project-windows-git.test.ts: override and inherited default, WSL-made worktrees, missing Git for Windows, worktree folder in the distro, already converted, distro gone, line-ending opt-in.wsl-drive-project-handlers.test.ts: gate, platform and argument checks; link reading from a real temp dir.project-execution-runtime.test.tsandproject-runtime-git-options.test.ts: Git routing and worktree placement.Review
Self-reviewed.
Agent skill upstream boundary
Notes
wslDriveProject:*IPC refuses unless it is Windows with the gate open (wsl-drive-project-handlers.ts). Base-ref lookups and the remote-identity sweep get their Git options fromgetProjectRuntimeReadGitOptions, which returns{}(host Git, as on main) while the gate is closed, so a Windows project already on a WSL runtime keeps main's Git for those reads. The new 'while WSL hosts are off' tests pin this. On macOS and Linux every runtime resolves to this computer, so the options are{}either way. The new optionalgitfield on a WSL runtime preference is written only by the gated convert flow; old builds and old servers ignore it.git.runs_inis a new trace attribute only.project.updateaccepts the new optional field. Older peers drop it, and the setting belongs to the local Windows host anyway.Status
5b29bb34c9e: rebased onto main88662806c0ewith no conflicts; every commit carried over unchanged (range-diff). fix(wsl-host): tell users how to fix a distro Orca can't host (D1c-1) #33085 is merged and feat(wsl): run Git for Windows for a WSL project on a Windows drive (D1c-2) #33090 targets main. CI: running on this head.readWorktreeLinks/isForeignLinkfromworktree-prune-guard.ts, so a//wsl.localhostlink counts as Windows Git's. Tests cover both.register-core-handlers.tsregisters the filesystem handlers in one call (the optional resolvers pass straight through, so nothing changes). Land the WSL project mover dark (merges only after verify-15b, the flag-off audit and green CI) #34059 left that file at the 300-line lint cap, and this stack's WSL wiring adds to it.pnpm tc,pnpm run typecheck:ci, the PR's tests,check:code-quality:changed, the anti-slop oxlint, repo oxlint and ast-grep (including the no-real-time-sleep test rules) and the e2e typecheck ratchet all pass locally on this head, run one branch at a time.