Skip to content

Avoid systeminfo when launching Fork's rebase editor#154

Open
camjac251 wants to merge 2 commits into
andy-5:developfrom
camjac251:perf/fork-rebase-editor
Open

Avoid systeminfo when launching Fork's rebase editor#154
camjac251 wants to merge 2 commits into
andy-5:developfrom
camjac251:perf/fork-rebase-editor

Conversation

@camjac251

@camjac251 camjac251 commented Jul 17, 2026

Copy link
Copy Markdown

Summary

  • Detect wslpath directly instead of starting cmd.exe /c systeminfo.
  • Detect WSL through WSL_INTEROP, with the historical kernel-name check as
    a fallback for older environments.
  • Validate the editor path and rebase-todo argument before conversion.
  • Propagate chmod and wslpath failures instead of launching the editor
    with an invalid path.
  • Add shell regressions for conversion, failure propagation, and custom WSL
    kernels whose uname output omits Microsoft.

Problem

Fork.RI only needs WSL interoperability and wslpath, but it previously
started a Windows systeminfo scan and parsed the Windows build number before
every interactive rebase.

That indirect probe adds an unnecessary Windows process to a latency-sensitive
editor path. A kernel-name-only replacement is also insufficient because
custom WSL kernels can omit Microsoft from uname while interoperability is
fully available.

Using WSL_INTEROP for environment detection and checking wslpath directly
tests the capabilities that the script actually needs.

Verification

  • bash -n resources/Fork.RI tests/fork-ri.sh
  • shellcheck resources/Fork.RI tests/fork-ri.sh
  • bash tests/fork-ri.sh
  • Host smoke test on a custom WSL kernel whose uname output omits
    Microsoft
  • git diff --check develop...HEAD
  • Start an interactive rebase from Fork and confirm the rebase-todo editor
    opens without invoking cmd.exe /c systeminfo

Compatibility

The existing FORK_RI_EXE_PATH normalization and Windows-path conversion
remain in place. The script still launches the configured Fork.RI.exe with a
single converted rebase-todo path.

WSL_INTEROP is preferred when present. The historical Microsoft kernel-name
match remains as a fallback. Missing wslpath retains
exit status 1, while missing editor configuration or an invalid argument count
returns exit status 2.

Related issues

Related to #153. This removes the cmd.exe /c systeminfo invocation reported
there, but it does not claim to resolve unrelated failures while launching the
Windows editor executable itself.

Check for wslpath directly instead of launching a Windows system
scan. Validate the editor inputs and propagate conversion failures so
the rebase editor is never started with an invalid path.

Keep the shell harness on a relative script path so failures do not
expose the absolute checkout location.
@camjac251
camjac251 marked this pull request as ready for review July 17, 2026 22:09
Custom WSL kernels may omit Microsoft from uname even when Windows
interoperability and wslpath are available. Prefer WSL_INTEROP while
retaining the kernel-name fallback for older WSL environments.
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.

1 participant