Skip to content

feat(wsl): offer Git for Windows in a Windows-drive WSL project's settings (D1c-3) - #33097

Merged
nwparker merged 3 commits into
mainfrom
nwparker/wsl-d1c-3-windows-git-ui
Oct 29, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/wsl-d1c-3-windows-git-ui

Conversation

@nwparker

@nwparker nwparker commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​54 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​54
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​261 $\color{#cf222e}{\Huge{\mathbf{−}}}$​5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​256

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

  • New row. Project settings → Project Runtime gets a "Git" row, shown only when all of these hold:
    • WSL hosts are on (internal gate plus the Experimental switch).
    • The project's runtime resolves to WSL.
    • The project's folder is on a Windows drive.
  • Before conversion. The row explains that Git in WSL is slow there and misses Windows-side changes, and offers "Use Git for Windows". Clicking it:
    • asks main to check the project and shows any blockers in plain words (Git for Windows missing, WSL-made workspaces with their paths, worktree folder inside WSL, runtime needs repair);
    • otherwise says nothing in Orca changes (tabs, terminals, chats, workspaces) and offers a checked-by-default box to also set core.autocrlf in the repo, shown only when that would help;
    • on Confirm, saves the returned runtime setting through the normal project update.
  • After conversion. The row reads "Orca runs Git on Windows for this project. Terminals and agents still run in ." There is no action on it.
  • Distro switch. Changing the distro in the runtime selector keeps Git for Windows. Before this, picking another distro wrote a fresh setting and would have silently gone back to WSL Git.

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

  • Automated tests added: WslDriveProjectGitRow.test.tsx (offer, converted state, hidden for Windows-runtime and in-distro projects, blocker copy).
  • Manual on Windows: pending.

Review

Self-reviewed.

Agent skill upstream boundary

  • Not applicable.

Notes

  • Flag-off: no change. The Git for Windows row renders only when 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 keeps git only 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

@nwparker
nwparker force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch from 9721af4 to 820451d Compare October 24, 2026 08:50
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-2-windows-git branch from 4744e59 to ae05cd2 Compare October 25, 2026 02:00
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch from 820451d to 85eaf0a Compare October 25, 2026 02:00
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-2-windows-git branch from ae05cd2 to 2f43ad5 Compare October 25, 2026 02:29
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch from 85eaf0a to 26e4f21 Compare October 25, 2026 02:30
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-2-windows-git branch from 2f43ad5 to 7a5ca94 Compare October 25, 2026 04:34
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch from 26e4f21 to 102d859 Compare October 25, 2026 04:34
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-2-windows-git branch from 7a5ca94 to 73563e1 Compare October 25, 2026 06:39
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch from 102d859 to 6920507 Compare October 25, 2026 06:40
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-2-windows-git branch from 73563e1 to bd03615 Compare October 25, 2026 08:30
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch from 6920507 to 7105dc1 Compare October 25, 2026 08:30
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-2-windows-git branch from bd03615 to 5f403b6 Compare October 25, 2026 09:48
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch from 7105dc1 to acd9c2d Compare October 25, 2026 09:48
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-2-windows-git branch from 5f403b6 to 9f1aaf2 Compare October 25, 2026 10:21
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch from acd9c2d to cc589b8 Compare October 25, 2026 10:21
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-2-windows-git branch from 9f1aaf2 to 4d04511 Compare October 25, 2026 11:10
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch 2 times, most recently from 727b8be to 6b24e8c Compare October 25, 2026 11:59
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-2-windows-git branch from 090d7be to e511133 Compare October 25, 2026 12:36
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch from 6b24e8c to 9bc5b72 Compare October 25, 2026 12:36
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-2-windows-git branch from e511133 to 767b00d Compare October 25, 2026 13:03
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch from 9bc5b72 to e247268 Compare October 25, 2026 13:03
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-2-windows-git branch from 767b00d to ab406c7 Compare October 25, 2026 13:16
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch from e247268 to 61534ac Compare October 25, 2026 13:16
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-2-windows-git branch from ab406c7 to d19fc7b Compare October 27, 2026 23:53
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch from 61534ac to 6170884 Compare October 27, 2026 23:53
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-2-windows-git branch from d19fc7b to 7149b9f Compare October 28, 2026 02:11
@nwparker
nwparker force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch from 6170884 to c553e78 Compare October 28, 2026 02:12
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-2-windows-git branch from 7149b9f to a476da8 Compare October 28, 2026 02:20
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch 3 times, most recently from b19ac70 to 77aa4b2 Compare October 28, 2026 10:47
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-2-windows-git branch from 0ed2ccc to 100ec35 Compare October 28, 2026 10:48
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch from 77aa4b2 to 462b073 Compare October 28, 2026 11:30
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-2-windows-git branch from 6706826 to 695780a Compare October 28, 2026 12:05
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch from 462b073 to 47c5a07 Compare October 28, 2026 12:05
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-2-windows-git branch from 695780a to 5b29bb3 Compare October 28, 2026 20:57
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch from 47c5a07 to a683039 Compare October 28, 2026 20:57
@greptile-apps

greptile-apps Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[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

  1. P1 Conversion overwrites newer runtime choices ▶
  2. P2 Failed saves show no error ▶
  3. P2 Cancel still switches Git ▶

Summary

Adds an inline Git for Windows choice for WSL projects stored on Windows drives.

  • WSL projects on Windows drives can switch Git to Windows from settings.
  • Changing the WSL distro keeps Git running on Windows.

Reviews (3) · Last reviewed commit: "Merge branch 'main' into nwparker/wsl-d1..." · Reviewed by Greptile

Comment on lines +72 to +73
await updateProject(projectId, { localWindowsRuntimePreference: result.preference })
setStep({ kind: 'idle' })

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Failed saves show no error

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.

Comment on lines +67 to +72
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 })

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

nwparker and others added 2 commits October 28, 2026 15:19
…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>
@OrcaWin
OrcaWin force-pushed the nwparker/wsl-d1c-3-windows-git-ui branch from a683039 to ec56df4 Compare October 28, 2026 22:47
@OrcaWin
OrcaWin changed the base branch from nwparker/wsl-d1c-2-windows-git to main October 28, 2026 22:47
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

The project runtime settings now retain an existing WSL Git preference when the distro changes. Repository settings conditionally show a Git conversion row for eligible WSL projects on Windows drives. The row provides preview and conversion states, blocker messages, and optional line-ending guidance. A successful conversion updates the project runtime preference. Tests cover key rendering conditions and blocker text, and English localization adds the flow’s messages.

Priority: Normal

Merge Risk: Moderate · up to f58b5

The conversion can appear to finish without saving the Git setting, or proceed after the user cancels. A later distro change can also undo the setting. Resolve these behaviors and clarify which repositories the line-ending option changes before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: offering Git for Windows for WSL projects on Windows drives.
Description check Passed The description is detailed and covers the user-facing behavior, implementation scope, rationale, linked work, testing, platform impact, and review status. It also records that visual proof is unavail…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is detailed and covers the user-facing behavior, implementation scope, rationale, linked work, testing, platform impact, and review status. It also records that visual proof is unavailable and manual Windows testing remains pending.

Full details: Docstring Coverage

Explanation

Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 6 functions across 5 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@OrcaWin

OrcaWin commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

STATUS: the D1c stack is restacked onto main 64344142fa0, which includes #33090's squash merge bfbdcd7e807 and #35357. Both safety-review fixes (#33531 and #33135) are pushed. #33097 now targets main. Nothing merged.

PR Head Base
#33097 ec56df4ee03 main 64344142fa0
#33108 4c5a34243f4 #33097
#33128 c3f617533ad #33108
#33135 74d1a1b05bc #33128
#33143 a30bcc848a0 #33135
#33122 167b6010b14 #33143
#33531 ca2ec49bbfd #33122

Conflicts resolved by hand: en.json conflicted with #35357's keys in #33097 (d057f754207) and #33143 (2a5745af369). I resolved both as a JSON three-way merge: main's file plus exactly the keys each commit adds, each placed after the same sibling key. A check shows all of main's keys and all 35 of the stack's keys kept, with no extras. Compared with the previous heads, only brace lines moved.

Safety-review fixes:

Checks: each PR passed the full load rule on its head, one at a time: pnpm tc, typecheck:ci, the e2e typecheck ratchet, the touched tests, check:code-quality:changed, anti-slop oxlint, repo oxlint, and the ast-grep rules including the no-real-time-sleep test rules. git status --short was empty after every rebase. All seven PRs show as mergeable. CI is starting now.

Comment on lines +143 to +145
<Button type="button" variant="ghost" size="sm" onClick={() => setStep({ kind: 'idle' })}>
{translate('wslDriveProject.cancel', 'Cancel')}
</Button>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Cancel still switches Git

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Commits

Reviewing files that changed from the base of the PR and between ed8f62c and f58b5c1.

Files selected for processing: 6
  • src/renderer/src/components/settings/ProjectWindowsRuntimeSetting.tsx
  • src/renderer/src/components/settings/repository/execution/RepositoryWindowsRuntimeSection.tsx
  • src/renderer/src/components/wsl-drive-project/WslDriveProjectGitRow.test.tsx
  • src/renderer/src/components/wsl-drive-project/WslDriveProjectGitRow.tsx
  • src/renderer/src/components/wsl-drive-project/wsl-drive-project-copy.ts
  • src/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.

Comment on lines +108 to +110
preference.kind === 'wsl' && preference.git
? { kind: 'wsl', distro, git: preference.git }
: { kind: 'wsl', distro }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

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)

Comment on lines +72 to +73
await updateProject(projectId, { localWindowsRuntimePreference: result.preference })
setStep({ kind: 'idle' })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major · Functional Correctness · Quick win

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.'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

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' })}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

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)

@nwparker
nwparker merged commit e6a2708 into main Oct 29, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants