Skip to content

feat(git): override branch.autosetupmerge=false via CLAUDE_ENV_FILE#61

Merged
cblecker merged 1 commit into
mainfrom
feat/git-autosetupmerge-override
Jun 26, 2026
Merged

feat(git): override branch.autosetupmerge=false via CLAUDE_ENV_FILE#61
cblecker merged 1 commit into
mainfrom
feat/git-autosetupmerge-override

Conversation

@cblecker

@cblecker cblecker commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Writes GIT_CONFIG_COUNT/GIT_CONFIG_KEY_n/GIT_CONFIG_VALUE_n environment variables to CLAUDE_ENV_FILE to set branch.autosetupmerge=false for the session
  • Uses deferred expansion (single-quoted heredoc) so entries are additive with other plugins or pre-existing environment values
  • Bumps git plugin version to 1.5.0

Test plan

  • Tested with 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 2
  • Validate plugin: claude plugin validate ./git

Summary by CodeRabbit

  • New Features

    • Git session startup now applies a safe config override when available, helping prevent unintended branch tracking behavior.
  • Bug Fixes

    • Improved Git branch creation defaults by setting branch.autosetupmerge to false in supported sessions.
  • Documentation

    • Updated Git setup notes to describe the new session-start configuration behavior.

Copilot AI review requested due to automatic review settings June 26, 2026 04:49
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cblecker, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 655660b8-79b9-4afb-acbd-0b40603a02ed

📥 Commits

Reviewing files that changed from the base of the PR and between 3245a13 and 7212f08.

📒 Files selected for processing (4)
  • git/.claude-plugin/plugin.json
  • git/CLAUDE.md
  • git/README.md
  • git/scripts/git-instructions.sh
📝 Walkthrough

Walkthrough

The PR adds a session-start Git config override path using CLAUDE_ENV_FILE, documents the new override flow in the Git plugin docs, and bumps the plugin manifest version to 1.5.0.

Changes

Git config override flow

Layer / File(s) Summary
SessionStart override wiring
git/CLAUDE.md, git/scripts/git-instructions.sh
The SessionStart pipeline adds a CLAUDE_ENV_FILE step, and git-instructions.sh appends indexed GIT_CONFIG_* override entries when the file is present.
Override documentation
git/CLAUDE.md, git/README.md
The docs describe the environment-based Git config override format and the branch.autosetupmerge=false setting.

Plugin manifest version

Layer / File(s) Summary
Manifest version update
git/.claude-plugin/plugin.json
The plugin manifest version field is updated from 1.4.0 to 1.5.0.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐇 I hopped through SessionStart with a flick of my ear,
and tucked GIT_CONFIG_COUNT where the shell could hear.
branch.autosetupmerge went softly to false,
then off I bounced onward, with carrots in my vault.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: setting branch.autosetupmerge=false via CLAUDE_ENV_FILE in the git plugin.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/git-autosetupmerge-override

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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_FILE in git-instructions.sh using deferred expansion for additive behavior.
  • Documents the new mechanism in README.md and CLAUDE.md (flow diagram + override tables).
  • Bumps the git plugin version from 1.4.0 to 1.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.

Comment thread git/README.md Outdated
@cblecker

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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
@cblecker cblecker force-pushed the feat/git-autosetupmerge-override branch from 3245a13 to 7212f08 Compare June 26, 2026 05:14
@cblecker cblecker enabled auto-merge June 26, 2026 05:14
@cblecker cblecker merged commit 0873acc into main Jun 26, 2026
12 checks passed
@cblecker cblecker deleted the feat/git-autosetupmerge-override branch June 26, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants