Skip to content

Skip git commit lookup when env is set to disable#349

Open
dan-manges wants to merge 2 commits intomainfrom
dan/disable-git
Open

Skip git commit lookup when env is set to disable#349
dan-manges wants to merge 2 commits intomainfrom
dan/disable-git

Conversation

@dan-manges
Copy link
Member

@dan-manges dan-manges commented Feb 15, 2026

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

  • Adds RWX_DISABLE_GIT_PATCH environment variable to disable git-related operations
  • When set, skips fetching git commit SHA, branch, and origin URL
  • Also disables patch generation for non-git use cases

Test plan

  • Test rwx run with RWX_DISABLE_GIT_PATCH set outside a git repo
  • Test rwx run without the env var to confirm normal behavior unchanged

🤖 Generated with Claude Code

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>
@dan-manges dan-manges changed the title Add RWX_DISABLE_GIT_PATCH env var to skip git operations Skip git commit lookup when env is set to disable Feb 15, 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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments