Repository navigation
Silence git stderr in non-repository folders (fixes 'fatal: not a git repository' noise) - #2
Open
D3mianGianoz wants to merge 1 commit into
Open
D3mianGianoz wants to merge 1 commit into
D3mianGianoz wants to merge 1 commit into
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.
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