Repository navigation
feat(wsl): offer Git for Windows in a Windows-drive WSL project's settings (D1c-3) - #33097
Conversation
9721af4 to
820451d
Compare
4744e59 to
ae05cd2
Compare
820451d to
85eaf0a
Compare
ae05cd2 to
2f43ad5
Compare
85eaf0a to
26e4f21
Compare
2f43ad5 to
7a5ca94
Compare
26e4f21 to
102d859
Compare
7a5ca94 to
73563e1
Compare
102d859 to
6920507
Compare
73563e1 to
bd03615
Compare
6920507 to
7105dc1
Compare
bd03615 to
5f403b6
Compare
7105dc1 to
acd9c2d
Compare
5f403b6 to
9f1aaf2
Compare
acd9c2d to
cc589b8
Compare
9f1aaf2 to
4d04511
Compare
727b8be to
6b24e8c
Compare
090d7be to
e511133
Compare
6b24e8c to
9bc5b72
Compare
e511133 to
767b00d
Compare
9bc5b72 to
e247268
Compare
767b00d to
ab406c7
Compare
e247268 to
61534ac
Compare
ab406c7 to
d19fc7b
Compare
61534ac to
6170884
Compare
d19fc7b to
7149b9f
Compare
6170884 to
c553e78
Compare
7149b9f to
a476da8
Compare
b19ac70 to
77aa4b2
Compare
0ed2ccc to
100ec35
Compare
77aa4b2 to
462b073
Compare
6706826 to
695780a
Compare
462b073 to
47c5a07
Compare
695780a to
5b29bb3
Compare
47c5a07 to
a683039
Compare
[Medium impact] The change affects a bounded local Windows-and-WSL project settings workflow. The PR should not merge until conversion stops overwriting newer runtime choices. Findings
SummaryAdds an inline Git for Windows choice for WSL projects stored on Windows drives.
Reviews (3) · Last reviewed commit: "Merge branch 'main' into nwparker/wsl-d1..." · Reviewed by Greptile |
| await updateProject(projectId, { localWindowsRuntimePreference: result.preference }) | ||
| setStep({ kind: 'idle' }) |
There was a problem hiding this comment.
convert ignores the result of updateProject, which returns false when saving fails instead of throwing. The row then returns to idle without showing an error. Git stays in WSL, even though conversion may already have changed core.autocrlf. Check the save result and keep the review open with an error when it fails.
| const result = await window.api.wslDriveProject.convert({ projectId, alignLineEndings }) | ||
| if (!result.ok) { | ||
| setStep({ kind: 'review', preview: { ...preview, blockers: result.blockers } }) | ||
| return | ||
| } | ||
| await updateProject(projectId, { localWindowsRuntimePreference: result.preference }) |
There was a problem hiding this comment.
Conversion overwrites newer runtime choices
The runtime selector stays usable while convert is running. Conversion reads the distro before awaiting several Git calls, then saves that earlier distro unconditionally. If the user changes the distro or switches to Windows meanwhile, conversion can overwrite their newer choice and put the project back on the old WSL distro. Prevent competing runtime edits during conversion, or reject the save when the preference has changed.
…tings Project settings show a Git row for a WSL-runtime project on a Windows drive (WSL hosts on). "Use Git for Windows" checks the project, shows any blocker in plain words, optionally sets core.autocrlf in the repo, and saves the returned runtime through the normal project update. Once converted the row says where Git and terminals run. Switching the distro keeps Git for Windows instead of silently dropping it. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
a683039 to
ec56df4
Compare
Walkthrough
Priority: Merge Risk:
|
|
STATUS: the D1c stack is restacked onto main
Conflicts resolved by hand: Safety-review fixes:
Checks: each PR passed the full load rule on its head, one at a time: |
| <Button type="button" variant="ghost" size="sm" onClick={() => setStep({ kind: 'idle' })}> | ||
| {translate('wslDriveProject.cancel', 'Cancel')} | ||
| </Button> |
There was a problem hiding this comment.
Clicking Cancel while conversion is running only hides the review. The pending convert call still finishes, writes core.autocrlf when requested, and saves the new Git choice through updateProject. A user who cancels can therefore still have their project and repo settings changed. Disable Cancel during conversion, or make it stop the operation before allowing changes.
There was a problem hiding this comment.
Actionable comments posted: 4

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
624f4cf7-7bb8-4e40-b34a-91b778799fd9
Files selected for processing: 6-
src/renderer/src/components/settings/ProjectWindowsRuntimeSetting.tsxsrc/renderer/src/components/settings/repository/execution/RepositoryWindowsRuntimeSection.tsxsrc/renderer/src/components/wsl-drive-project/WslDriveProjectGitRow.test.tsxsrc/renderer/src/components/wsl-drive-project/WslDriveProjectGitRow.tsxsrc/renderer/src/components/wsl-drive-project/wsl-drive-project-copy.tssrc/renderer/src/i18n/locales/en.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
-
| preference.kind === 'wsl' && preference.git | ||
| ? { kind: 'wsl', distro, git: preference.git } | ||
| : { kind: 'wsl', distro } |
There was a problem hiding this comment.
Preserve a Git conversion made while a distro change is pending.
If live sessions defer a distro change, pendingPreference captures the Git setting at selection time. The adjacent Git row can then convert the project to Windows Git. When the user applies the pending distro change, commitRuntimePreference saves that older preference and removes git: 'windows-host'. Reconcile the pending distro with the latest project Git preference before applying it. (raw.githubusercontent.com)
| await updateProject(projectId, { localWindowsRuntimePreference: result.preference }) | ||
| setStep({ kind: 'idle' }) |
There was a problem hiding this comment.
Check whether the project update succeeded.
If updateProject fails, the store resolves false rather than throwing. This code still returns to idle without an error, although the project has not switched to Windows Git. Check for a failed result and keep the failure visible so the user can retry. (raw.githubusercontent.com)
| <Label htmlFor={`wsl-drive-line-endings-${projectId}`}> | ||
| {translate( | ||
| 'wslDriveProject.lineEndings', | ||
| 'Also set core.autocrlf in this repo, so git in WSL terminals stops showing every file as changed.' |
There was a problem hiding this comment.
Describe the full scope of the line-ending change.
The checkbox says it will set core.autocrlf in “this repo.” For a project with multiple eligible repositories, conversion writes that setting in each of them. Update this label and its English catalog entry to state that scope before the user confirms. (raw.githubusercontent.com)
| ) : null} | ||
| {preview ? ( | ||
| <div className="flex justify-end gap-2"> | ||
| <Button type="button" variant="ghost" size="sm" onClick={() => setStep({ kind: 'idle' })}> |
There was a problem hiding this comment.
Do not offer Cancel after conversion starts.
During converting, Cancel returns the row to idle but does not stop the IPC request. The request can still change repository configuration and save the Git preference after the user cancels. Disable Cancel during conversion unless the operation supports cancellation. (raw.githubusercontent.com)
ELI5
This adds the button for the previous PR. In a project's settings, a Windows-drive project that runs in WSL gets a "Git" row offering "Use Git for Windows". Orca checks the project first, says plainly if something blocks the switch, and otherwise switches Git while terminals and agents stay in WSL.
What Changed
core.autocrlfin the repo, shown only when that would help;Why
The owner decided Windows-drive WSL projects convert. The conversion is explicit, with a check first, because it can refuse (see #33090), and because the line-ending fix writes to the user's repo. A dedicated dialog would duplicate the settings row's context, so the steps stay inline.
Linked Issue
Part of the WSL re-write, step D1c (R36, R37). Stacked on #33090.
Visual Proof
Not captured: the row appears only for local Windows projects, and the shared Windows box is busy with another verification. The render test asserts the copy for each state.
Testing
WslDriveProjectGitRow.test.tsx(offer, converted state, hidden for Windows-runtime and in-distro projects, blocker copy).Review
Self-reviewed.
Agent skill upstream boundary
Notes
useWslHostsEnabled()is true (RepositoryWindowsRuntimeSection.tsx). That needs the preload WSL bridge, which is exposed only with ORCA_INTERNAL_WSL_HOSTS=1 on Windows (wsl-hosts-api.ts), and the check is null-safe in the web and mobile clients. No new UI and no IPC calls. The runtime-setting edit keepsgitonly when it was already saved, and only the gated convert flow saves it.UI only. It doesn't affect SSH or remote projects, since the row requires a local Windows project.
Status
ec56df4ee03: rebased onto main64344142fa0, which has feat(wsl): run Git for Windows for a WSL project on a Windows drive (D1c-2) #33090 squash-merged (fix(wsl-host): tell users how to fix a distro Orca can't host (D1c-1) #33085 earlier) and fix(wsl-mover): hold an app update install while a moved project comes back #35357; feat(wsl): offer Git for Windows in a Windows-drive WSL project's settings (D1c-3) #33097 now targets main. Every commit is kept. CI: running on this head.en.jsonagainst fix(wsl-mover): hold an app update install while a moved project comes back #35357's keys. I took main's file plus exactly the keys this PR adds; a check shows all of main's keys and all of this PR's keys kept, nothing else.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.