{{ message }}
tap: link completions only for canonical origins - #23823
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The security-sensitive behaviour is consistently applied and covered, with only a minor performance optimisation suggested.
Pull request overview
Restricts automatic completion trust to official taps using canonical Git origins.
Changes:
- Adds
Tap#official_git_checkout?. - Applies origin verification when linking, unlinking and counting completions.
- Updates tap and completion tests.
File summaries
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: Patrick Linnane <patrick@linnane.io>
p-linnane
force-pushed
the
completion-origin-trust
branch
from
September 6, 2026 01:00
0a4c6cb to
046a0de
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Completion and manpage linking trusted any tap whose name looks official, so a tap named
homebrew/foocloned from a custom remote had its shell completions linked automatically even though the trust checks would not run its Ruby. AddTap#official_git_checkout?, which requires the checkout's actual Git origin to be the canonical remote, and use it where completions are linked, unlinked and counted, so only canonical official checkouts get automatic completion trust.brew benchmarkresults.brewcommands to reproduce the bug?brew lgtm(style, typechecking and tests) locally?GPT-6 Astra and Claude Code (Fable 5.1) drafted the implementation and tests; I reviewed the diff, verified the new test fails without the change and the updated specs pass with it, and ran
brew lgtm --onlineplus targeted specs.