Skip to content

Allow resetting Git remotes to their defaults - #24368

Merged
MikeMcQuaid merged 1 commit into
mainfrom
issue_24364_reset_core_git_remote
Oct 27, 2026
Merged

MikeMcQuaid merged 1 commit into
mainfrom
issue_24364_reset_core_git_remote

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member

Preserve mirror remotes unless users explicitly select defaults.

Fixes #24364


  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

Codex with GPT 6 Astra at Extra High effort, with local review and testing.


- Preserve mirror remotes unless users explicitly select defaults.

Fixes #24364
@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6aa1cd0f-5720-410f-9cf3-891331ad770a
Commits

Reviewing files that changed from the base of the PR and between 9999947 and 745e907.

Files selected for processing: 3
  • Library/Homebrew/cmd/update.sh
  • Library/Homebrew/test/cmd/update_spec.rb
  • docs/Installation.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • brew update now respects explicitly selected brew and core remotes, including when they match the default remotes. This applies to regular updates and automatic updates.
  • Documentation
    • Updated installation guidance to clarify how mirror settings affect installation and later updates, and added commands for resetting both repositories to their GitHub remotes.

The update script now checks whether brew and core remote variables were explicitly set, even when their values match the defaults. Tests cover remote selection, and the installation guidance explains how unset variables affect installation and later updates.

Changes: Remote selection and reset

Layer / File(s) Summary
Remote selection and reset behavior
Library/Homebrew/cmd/update.sh, Library/Homebrew/test/cmd/update_spec.rb, docs/Installation.md
The update script checks explicit brew and core remote settings, including settings equal to the defaults. Parameterised tests cover explicit and implicit defaults, non-default remotes, and regular and --auto-update runs. Installation guidance describes the behavior of unset mirror variables and gives commands to reset both remotes to their GitHub URLs.

Priority: Normal

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 745e9

The change is mergeable after normal checks; no actionable remote-reset risk remains in the reviewed evidence.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly describes the main change: allowing users to reset Git remotes to their default repositories.
Description check Passed The description explains the remote-preservation behaviour, references the related issue, and confirms relevant tests and validation steps.
Linked Issues check Passed Issue #24364 requires explicit default values to reset the local brew and core Git remotes while preserving mirror remotes when the variables are implicit. update.sh now checks `HOMEBREW_USER_SET_VA…
Out of Scope Changes check Passed The changed files support the linked issue. The shell change implements explicit remote selection. The tests verify the reset and preservation behaviour. The installation documentation explains the be…
Full details: Linked Issues check

Explanation

Issue #24364 requires explicit default values to reset the local brew and core Git remotes while preserving mirror remotes when the variables are implicit. update.sh now checks HOMEBREW_USER_SET_VARS for both remote variables. The update logic therefore applies an explicit default and retains an implicit default's existing remote. update_spec.rb tests explicit defaults, implicit defaults, non-default remotes, and both normal and --auto-update paths.

Full details: Out of Scope Changes check

Explanation

The changed files support the linked issue. The shell change implements explicit remote selection. The tests verify the reset and preservation behaviour. The installation documentation explains the behaviour and gives reset commands. No unrelated change is evidenced.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@MikeMcQuaid
MikeMcQuaid enabled auto-merge October 27, 2026 09:49

@ZhongRuoyu ZhongRuoyu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit a59d9fc Oct 27, 2026
55 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the issue_24364_reset_core_git_remote branch October 27, 2026 14:54
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.

Allow resetting HOMEBREW_BREW/CORE_GIT_REMOTE to default

2 participants

⌂ 换网址