Repository navigation
Silence git stderr in non-repository folders (fixes 'fatal: not a git repository' noise) - #2
Merged
hypnguyen1209 merged 1 commit intoNov 2, 2026
Conversation
When the working folder is not a git repository, git calls (rev-parse, stash create, update-ref) printed 'fatal: not a git repository' to the terminal on every risky command and on /yolo rewind. The errors are already caught internally, but their stderr leaked through. Pass stdio: ["ignore", "pipe", "ignore"] to the 5 execFileSync("git", ...) calls. Behavior in repos is unchanged; in non-repos the git ops fail silently instead of printing.
hypnguyen1209
approved these changes
Nov 2, 2026
hypnguyen1209
left a comment
Contributor
There was a problem hiding this comment.
Approved. Correct and complete: the issue is cosmetic (yolo already handles the failures — gitHead returns null, decideCheckpoint returns {failed:true}), it is only git's stderr leaking, and stdio: ["ignore", "pipe", "ignore"] silences stderr while keeping stdout for the calls that read it (rev-parse HEAD, the checkpoint runGit). I confirmed all five execFileSync("git", …) sites in extensions/yolo.ts are covered — rev-parse, the checkpoint runGit and update-ref, releaseRefs' update-ref, and the /yolo rewind restore — and there are no other git spawns that could leak. Merged onto current main (0.16.1): clean, tsc --noEmit passes, 135 tests green. Thanks!
hypnguyen1209
added a commit
that referenced
this pull request
Nov 2, 2026
Ships the community fix from #2 (by @D3mianGianoz): the five execFileSync("git", …) calls now pass stdio: ["ignore", "pipe", "ignore"], so git's "fatal: not a git repository" no longer leaks to the terminal on every risky command or /yolo rewind when the cwd is not a repo. yolo already handled the failures internally; this only silences the noise. Stdout is kept for the calls that read it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When working in a folder that is not a git repository, yolo prints git fatal messages on every risky bash/powershell command and on
/yolo rewind:The extension already handles these failures internally (
gitHeadreturns null,decideCheckpointreturns{failed:true}), butexecFileSync("git", ...)uses the defaultstdio, so git's stderr leaks to the terminal. It is noise, not a functional issue — commands still behave per mode and the trail still logs.Fix: pass
stdio: ["ignore", "pipe", "ignore"]to the 5execFileSync("git", ...)calls inextensions/yolo.ts(gitHead, gitCheckpoint runGit/update-ref, releaseRefs, /yolo rewind restore). Stdout keeps working; only stderr is silenced.Related issue: #1