Skip to content

fix(desktop): respect HERMES_GIT_BASH_PATH in findGitBash() (salvage #64339) - #70265

Merged
teknium1 merged 4 commits into
mainfrom
salvage/64339-git-bash-path
Jul 24, 2026
Merged

fix(desktop): respect HERMES_GIT_BASH_PATH in findGitBash() (salvage #64339)#70265
teknium1 merged 4 commits into
mainfrom
salvage/64339-git-bash-path

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Salvages the desktop-parity subset of PR #64339 by @seamusmore: the Electron desktop's git-bash resolver now honors HERMES_GIT_BASH_PATH, matching the terminal runtime (tools/environments/local.py has honored it all along — the desktop's own findGitBash never checked it).

Changes

  • apps/desktop/electron/find-git-bash.ts (new): resolver extracted into a testable module with the env-override rung first, then well-known install paths, then PATH
  • apps/desktop/electron/main.ts: delegates to the new module
  • apps/desktop/electron/find-git-bash.test.ts (new): 4 vitest regression tests
  • Follow-ups (ours): Windows path joining via path.win32, eslint/prettier conformance, contributor email mapping

The original PR's console/AllocConsole work was mooted by #70205 and is not included — this extracts only the parity fix.

Validation

Result
Desktop electron suite (npx vitest run --project electron) 697 passed, 2 skipped
npm run typecheck (3 tsconfigs) clean
eslint + prettier on touched files clean

Authorship preserved via cherry-pick (contributor commit stat matches the original exactly); rebase-merge.

Closes #64339 (console portion superseded by #70205; parity portion salvaged here).

Infographic

git-bash-path

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on ed6b660

all good!

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) platform/windows Native Windows-specific behavior or breakage area/config Config system, migrations, profiles sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Jul 23, 2026
seamusmore and others added 4 commits July 23, 2026 16:24
Port the HERMES_GIT_BASH_PATH env var check from main.cjs to main.ts
after the TS conversion. Also extract findGitBash to a dedicated module
for testability and add focused regression tests for override precedence
and invalid-override fallback.
…t-bash

The extracted findGitBash builds Windows-style candidate paths, but the
vitest suite (and any POSIX CI host) runs with posix path.join, which
mangles 'C:\Program Files' + segments into slash-joined paths and broke
the invalid-override fallback test. Use path.win32.join explicitly so
candidate construction is host-independent.
…dule

npx eslint --fix + prettier --write on the new files: braces on
single-line if returns and blank-line padding per the desktop lint
config.
@teknium1
teknium1 force-pushed the salvage/64339-git-bash-path branch from 9f8c89b to ed6b660 Compare July 23, 2026 23:24
@teknium1
teknium1 merged commit fbf04ae into main Jul 24, 2026
45 checks passed
@teknium1
teknium1 deleted the salvage/64339-git-bash-path branch July 24, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have platform/windows Native Windows-specific behavior or breakage sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants