Disable interactive git credential prompts on network operations - #9
Conversation
Set GIT_TERMINAL_PROMPT=0 on fetch and push subprocesses so batch CLIs never leak Username/password prompts to the TTY when credentials are missing. Co-authored-by: Cursor <cursoragent@cursor.com>
📝 WalkthroughWalkthroughAdds ChangesNon-interactive Git environment
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot check passed with no issues, but no Cursor[bot] PR review comment (BUGBOT_REVIEW) was posted, so I cannot approve without that signal. Maintainer review is recommended; no reviewers were assigned (sole human contributor is the PR author).
Sent by Cursor Approval Agent: Pull Request Approver
## Summary - Bump `git-harness` to **v0.3.1** (released; sets `GIT_TERMINAL_PROMPT=0` on fetch/push) - Add executor integration tests for push-known and conflict-detection fetch paths ## Why `git-fire` delegates network git to `git-harness`. Without `GIT_TERMINAL_PROMPT=0`, parallel pushes/fetches can prompt for HTTPS credentials on the TTY when auth is missing. ## Related PRs - git-harness (merged, v0.3.1): git-fire/git-harness#9 - git-rain (sibling): git-fire/git-rain#16 ## Test plan - [x] `go test -race -count=1 ./internal/executor/ -run 'TestSummarizePushKnownRemote_Unauthenticated|TestDetectConflict_Unauthenticated' -v` - [x] `go.mod` pinned to `github.com/git-fire/git-harness v0.3.1` - [ ] CI green (GoReleaser config validation failure is pre-existing/unrelated) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Dependency bump and test-only executor coverage; release changes affect install path (cask) but not runtime app logic. > > **Overview** > **Pins `git-harness` to v0.3.1** so fetch/push run with `GIT_TERMINAL_PROMPT=0`, avoiding HTTPS credential prompts during parallel emergency backups when auth is missing. > > **Adds executor regression tests** (`network_git_test.go`) that hit real HTTPS remotes without credentials and assert `summarizePushKnownRemote` and `git.DetectConflict` fail quickly (within 15s), not hang on a TTY prompt. > > **Switches macOS distribution from a Homebrew formula to a cask** in `.goreleaser.stable.yaml` (binary + post-install `xattr` quarantine strip on macOS). The release workflow gate now polls `homebrew-tap`’s **cask** (`Casks/git-fire.rb`) instead of `Formula/git-fire.rb`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 08901fa. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Ben Schellenberger <bschellenberger2600@users.noreply.github.com>


Summary
PrepareNetworkGitto setGIT_TERMINAL_PROMPT=0on fetch/push subprocessesFetchRemote,DetectConflict,PushBranch, andPushAllBranchesWhy
Batch CLIs (
git-fire,git-rain) run parallel network git operations. When HTTPS remotes lack cached credentials, git prompts on the controlling TTY — bypassing captured stdout/stderr and interleavingUsername for 'https://github.com':with structured output.Related PRs
Merge order: this PR first → tag harness release → update git-fire #107
go.modpin → merge siblings.Test plan
go test -race -count=1 ./git/ -run 'TestNonInteractive|TestPrepareNetwork|TestFetchRemote_Unauthenticated' -v