pkg: run Git as the installation user #24019

Merged
MikeMcQuaid opened 7:05am on September 17, 2026 wanted to merge 137 Ξ” into homebrew/brew main from
pkg-git-install-user
Diff Delta:
137
About 316 Diff Delta/hour
Classified as:  General

MikeMcQuaid's Description of Work


  • Run repository Git commands and any programs they launch as the selected installation user.

  • Set ownership before Git runs and require a non-root account.

  • Use a system PATH and omit the user's global Git configuration.

  • Check command dispatch and root user rejection in tests.

  • Document installation ownership and when packages need sudo.



  • [x] Have you followed our Contributing guidelines?

  • [x] Have you checked for other open Pull Requests for the same change?

  • [x] Have you explained what your changes do? Performance claims (e.g. "this is faster") must include brew benchmark results.

  • [x] Have you explained why you'd like these changes included, not just what they do?

  • [x] For bug fixes, have you given step-by-step brew commands to reproduce the bug?

  • [x] Have you written new tests (excluding integration tests)? Here's an example.

  • [x] Have you successfully run brew lgtm (style, typechecking and tests) locally?



  • [x] 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.


6 total changed files
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
That’s the last hunk
Approve, request changes, or stare into the void (reviewer's choice) πŸ˜