Skip git commit lookup when env is set to disable#349
Open
dan-manges wants to merge 2 commits intomainfrom
Open
Skip git commit lookup when env is set to disable#349dan-manges wants to merge 2 commits intomainfrom
dan-manges wants to merge 2 commits intomainfrom
Conversation
When set, skips fetching git commit, branch, and origin URL, and disables patch generation. Useful for running outside of git repositories. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
jmsanders
approved these changes
Feb 16, 2026
| if err != nil { | ||
| return nil, errors.Wrap(err, "unable to determine git commit") | ||
| // Check if git operations are disabled | ||
| _, gitPatchDisabled := os.LookupEnv("RWX_DISABLE_GIT_PATCH") |
Contributor
There was a problem hiding this comment.
Should be pretty straightforward to test. There's even some old git history from when we were rolling this out that originally behaved this way.
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.
Dan's Notes
I ran into a scenario where I was starting an RWX run from a different git repository than I was testing against. I wanted to disable the patching entirely for this specific circumstance, but the CLI was still trying to resolve the git commit and failing, blocking me from starting a run.
Still not documenting this env or exposing via a flag, because I think this use case is very rare. We're just more likely to run into it internally.
Claude's Notes
Summary
RWX_DISABLE_GIT_PATCHenvironment variable to disable git-related operationsTest plan
rwx runwithRWX_DISABLE_GIT_PATCHset outside a git reporwx runwithout the env var to confirm normal behavior unchanged🤖 Generated with Claude Code