feat(git): override branch.autosetupmerge=false via CLAUDE_ENV_FILE#61
Conversation
|
Warning Review limit reached
More reviews will be available in 53 minutes and 17 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR adds a session-start Git config override path using ChangesGit config override flow
Plugin manifest version
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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.
Pull request overview
This PR enhances the git plugin so its SessionStart hook sets branch.autosetupmerge=false for the Claude Code session, preventing unintended branch tracking. Rather than mutating git config files (which the plugin's safety protocol forbids), it writes GIT_CONFIG_COUNT/GIT_CONFIG_KEY_n/GIT_CONFIG_VALUE_n environment variables to CLAUDE_ENV_FILE. The use of a single-quoted heredoc defers ${GIT_CONFIG_COUNT:-0} expansion to source-time, so the entries append at the next free index instead of clobbering entries from other plugins or the parent environment.
Changes:
- Appends git config override env vars to
CLAUDE_ENV_FILEingit-instructions.shusing deferred expansion for additive behavior. - Documents the new mechanism in
README.mdandCLAUDE.md(flow diagram + override tables). - Bumps the git plugin version from
1.4.0to1.5.0.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
git/scripts/git-instructions.sh |
Adds conditional block writing GIT_CONFIG_* env vars to CLAUDE_ENV_FILE with deferred expansion. |
git/README.md |
Documents the new git config override behavior and adds an overrides table. |
git/CLAUDE.md |
Updates the architecture diagram and explains the deferred-expansion/additive rationale. |
git/.claude-plugin/plugin.json |
Bumps plugin version to 1.5.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@coderabbitai review |
✅ Action performedReview finished.
|
Use GIT_CONFIG_COUNT/KEY/VALUE environment variables written to CLAUDE_ENV_FILE to set branch.autosetupmerge=false for the session. Deferred expansion ensures additivity with other plugins or pre-existing environment entries. Assisted-by: Claude:claude-opus-4-6
3245a13 to
7212f08
Compare
Summary
GIT_CONFIG_COUNT/GIT_CONFIG_KEY_n/GIT_CONFIG_VALUE_nenvironment variables toCLAUDE_ENV_FILEto setbranch.autosetupmerge=falsefor the sessionTest plan
GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=branch.autosetuprebase GIT_CONFIG_VALUE_0=false claude --plugin-dir ./git— verified plugin correctly appended at index 1 and bumped count to 2claude plugin validate ./gitSummary by CodeRabbit
New Features
Bug Fixes
branch.autosetupmergetofalsein supported sessions.Documentation