Skip to content

Git: keep non-ASCII paths, commit large selections via stdin, kill hung reads, and show real errors - #2021

Merged
currentbits merged 4 commits into
mainfrom
coder/reliability-git-path-handling-timeouts-a-e4a088
Nov 13, 2026
Merged

currentbits merged 4 commits into
mainfrom
coder/reliability-git-path-handling-timeouts-a-e4a088

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Four git reliability fixes.

  • Non-ASCII paths: lsFiles and searchFiles ran without -z or core.quotepath=off, so git returned quoted octal-escaped names ("caf\303\251.txt") that don't exist. @-mention and file search now get real UTF-8 paths. lsFiles also returns { files, truncated }, so hitting the 20,000-file cap is visible to the file tree instead of silent.
  • Large commits: committing a selection passed every path on argv, which can hit E2BIG or Windows' 32K command-line limit. Paths now go to git on stdin (--pathspec-from-file=- --pathspec-file-nul). Small selections behave the same.
  • Hung git reads: a git timeout only sent SIGTERM. A git process that ignored it blocked the main process on synchronous calls and never settled on asynchronous ones. Read-only calls now escalate to SIGKILL after a bounded wait.
    • Synchronous writes (commit, merge, add) are deliberately left alone, because a SIGKILL would leave a stale .git/index.lock, and Solenta can't recover from that.
  • Real git errors: gitStatus and isInsideWorkTree reported every failure as "not a repo", hiding problems like dubious ownership or a timeout. Now only git's "not a git repository" message, or a missing directory or binary, means not a repo. Any other failure throws with git's own message. A failed SSH connection to a remote project now shows as an error instead of "not a repo".

Tests: new electron/test/git-not-a-repo.test.js and git-timeout-kill.test.js, plus new cases in worktrees-commit.test.js and worktrees-searchfiles.test.js. 33 of 33 pass. The full Electron suite didn't finish locally, so CI is the first full run.

🤖 Generated with Claude Code

Willem and others added 4 commits November 13, 2026 15:19
…uncation

The @-mention file list and content search ran git ls-files and git grep
without -z, so git octal-escaped non-ASCII names ("caf\303\251.txt") into
paths that do not exist. Both now use -z and split on NUL.

lsFiles also cut repos at 20,000 paths without saying so. It now returns a
truncated flag: files:list passes it to the caller, and the Files pane's
existing truncated flag (whose cap matched lsFiles' cap, so it never fired
for git repos) now honours it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Committing a selection put every path on git's command line (Git pane
commit, partial-hunk commit, and the merge-time session commit), so a
large selection failed with E2BIG on macOS/Linux or hit Windows' 32K
command-line limit. pathspecArgs keeps today's argv for normal selections
and switches to --pathspec-from-file=- --pathspec-file-nul past 8,000
chars; gitTry gains an input option to write that stdin.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A timed-out git got one SIGTERM and nothing more. If it ignored that, the
async helpers (execCommandAsync, gitOutAsync, gitTryAsync) never called
back, and sync gitOut/gitTry blocked the main process until git exited.

Async: escalateKill SIGKILLs the child KILL_FALLBACK_MS (2s) after the
timeout and drops its pipes, so the call rejects or resolves as timed out
even when a hook grandchild holds stdout. Sync: execFileSync sends only
one signal, so read-only commands (already lock-free under
GIT_OPTIONAL_LOCKS=0) now time out with SIGKILL; writes keep SIGTERM so
git can still remove its index.lock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
gitStatus and isInsideWorkTree turned every git failure into "not a
repository", so "detected dubious ownership", timeouts and ssh errors were
hidden, and adding such a project as a new one tried `git init` on an
existing repo. Only git's "not a git repository" (or a missing directory
or binary) now reads as not-a-repo; other failures throw with git's
message, so git:status rejects with it and addProject reports it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T15:40:59.570610Z 298ee7c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@currentbits
currentbits merged commit dfe27ad into main Nov 13, 2026
14 checks passed
@currentbits
currentbits deleted the coder/reliability-git-path-handling-timeouts-a-e4a088 branch November 13, 2026 16:11
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