Skip to content

pkg: clean Homebrew git state#22081

Merged
MikeMcQuaid merged 1 commit intomainfrom
pkg-clean-git-state
Apr 25, 2026
Merged

pkg: clean Homebrew git state#22081
MikeMcQuaid merged 1 commit intomainfrom
pkg-clean-git-state

Conversation

@MikeMcQuaid
Copy link
Copy Markdown
Member

  • remove local Git hooks and .gitconfig during .pkg installs
  • warn in brew doctor when the Homebrew/brew repo contains them
  • avoid local Git customisations breaking installs or updates

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes. Non-maintainers may only have one AI-assisted/generated PR open at a time.

Used OpenAI Codex with manual/local review and editing.


Copilot AI review requested due to automatic review settings April 25, 2026 09:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 hardens Homebrew .pkg installs/updates against local Git customizations by removing repository-local hooks/config and adding a brew doctor warning when they’re detected.

Changes:

  • Remove .git/hooks and repository-local .gitconfig during .pkg postinstall repository reset.
  • Add a new brew doctor check to warn when Homebrew/brew contains Git hooks or a repo-local .gitconfig.
  • Add RSpec coverage for the new diagnostic check (including ignoring *.sample hooks).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
package/scripts/postinstall Removes repo-local Git hooks and .gitconfig during .pkg installation/reset steps.
Library/Homebrew/diagnostic.rb Adds check_homebrew_repository_git_hooks to surface problematic Git customizations in brew doctor.
Library/Homebrew/test/diagnostic_checks_spec.rb Adds unit tests validating the new diagnostic output and .sample hook exclusion.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread package/scripts/postinstall Outdated
Comment thread Library/Homebrew/diagnostic.rb Outdated
- remove local Git hooks and `.gitconfig` during `.pkg` installs
- warn in `brew doctor` when the `Homebrew/brew` repo contains them
- avoid local Git customisations breaking installs or updates
@MikeMcQuaid MikeMcQuaid force-pushed the pkg-clean-git-state branch from 5547725 to 9421ad1 Compare April 25, 2026 12:09
@MikeMcQuaid MikeMcQuaid enabled auto-merge April 25, 2026 12:20
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Apr 25, 2026
Merged via the queue into main with commit 38b048b Apr 25, 2026
48 checks passed
@MikeMcQuaid MikeMcQuaid deleted the pkg-clean-git-state branch April 25, 2026 14:00
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.

3 participants