Windows Git binary paths with spaces breaking review
NousResearch/hermes-agent · cluster 54888 · apps/desktop
Data as of
Nothing open on GitHub. Fix merged in #67612. Check it covers your case.
The short answer
- Known?
- Yes. 5 related items grouped here, 2 issues already closed.
- Fix event
- A fix was merged to main in PR #67612. Check it covers your case. No release data is tracked.
- Tracker
- The maintainers' tracker marks this
partially resolved, deciding PR #67612. That is separate from the fix event. - Still open
- Nothing open on GitHub.
Bug reports and fixes addressing simple-git failures on Windows when the Git binary path contains spaces, causing errors in the desktop review pane. Multiple fix attempts target the same underlying path-handling issue.
Open issues0
Open PRs0
Fixes on record
-
#67612 fix(desktop): support spaced Windows Git paths in review
files:
apps/desktop/electron/git-review-ops.test.ts,apps/desktop/electron/git-review-ops.tsShow the diff
-
apps/desktop/electron/git-review-ops.test.ts@@ -6,7 +6,7 @@ import path from 'node:path' import { afterEach, test } from 'vitest' -import { repoStatus, resolveRenamePath } from './git-review-ops' +import { gitFor, repoStatus, resolveRenamePath } from './git-review-ops' const tempDirs: string[] = [] @@ -34,6 +34,30 @@ test('resolveRenamePath: plain path is unchanged', () => { assert.equal(resolveRenamePath('src/a.ts'), 'src/a.ts') }) +test('gitFor accepts an internally resolved git binary path containing spaces', () => { + assert.doesNotThrow(() => gitFor(process.cwd(), 'C:\\Program Files\\Git\\cmd\\git.exe')) +}) + +test('gitFor runs git through a spaced binary path', async () => { + if (process.platform !== 'win32') { + return + } + + const gitBin = path.join(process.env.ProgramFiles || String.raw`C:\Program Files`, 'Git', 'cmd', 'git.exe') + + if (!fs.existsSync(gitBin)) { + return + } + + const repo = makeRepo() + + fs.writeFileSync(path.join(repo, 'changed.txt'), 'review me\n') + + const status = await gitFor(repo, gitBin).status() + + assert.equal(status.not_added.includes('changed.txt'), true) +}) + test('resolveRenamePath: simple rename resolves to the new path', () => { assert.equal(resolveRenamePath('old.ts => new.ts'), 'new.ts') }) -
apps/desktop/electron/git-review-ops.ts@@ -43,7 +43,20 @@ function runGh(args, cwd, ghBin): Promise<{ ok: boolean; stdout: string }> { } function gitFor(cwd, gitBin) { - return simpleGit({ baseDir: cwd, binary: gitBin || 'git', maxConcurrentProcesses: 4, trimmed: false }) + // `gitBin` is resolved inside the Electron main process from known install + // locations or PATH — never renderer/user input. simple-git's custom-binary + // validation rejects paths containing spaces (the default Windows install is + // `C:\Program Files\Git\cmd\git.exe`), which silently broke the Review pane. + // For spaced paths, opt into simple-git's trusted-binary escape hatch instead + // of falling back to PATH (often absent in GUI-launched apps, and PATH lookup + // could resolve a repo-local git.exe). + return simpleGit({ + baseDir: cwd, + binary: gitBin || 'git', + maxConcurrentProcesses: 4, + trimmed: false, + ...(gitBin && /\s/.test(gitBin) ? { unsafe: { allowUnsafeCustomBinary: true } } : {}) + }) } // simple-git reports renames as `old => new` (and `dir/{old => new}/f`); resolve @@ -680,6 +693,7 @@ async function repoStatus(repoPath, gitBin) { export { branchBase, fileDiffVsHead, + gitFor, repoStatus, resolveRenamePath, reviewCommit,
-
2 PRs closed without merging
From the close comments: done elsewhere 1 · merged via another change 1
Closed issues · 2
How this cluster was grouped
-
Link evidence (
structural links throughout): every member is connected by structural evidence: shared changed files, or a closing/superseded reference. -
Pairwise link density
0.44: the share of item pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36.1.00means every pair is linked.
Pick up a Lab task
Check whether a fix covers the open issues here, with your own agent. Bring back evidence for maintainers.
Open the LabAt a glance
- Subsystem
- apps/desktop
- Merged PRs
- #67612
- Closed issues
- 2
- Attempts
- 2 PRs closed without merging
- Fix link checked
- 19 Jul 2026