Support pinning casks#22276
Draft
MikeMcQuaid wants to merge 1 commit into
Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class pin/unpin support for casks so brew pin, brew unpin, brew list --pinned, brew info, brew upgrade, brew uninstall, brew reinstall, brew bundle, and the cask migrator all treat cask pins symmetrically with formula pins, including a warning that auto_updates true casks may still self-update outside Homebrew.
Changes:
- New
Cask::Cask#pin/unpin/pinned?/pinnable?/pinned_version/pin_pathAPI backed by symlinks under a newHOMEBREW_PINNED_CASKSdirectory; plus serialization (to_h, fixtures) and migrator handling. pin/unpin/list --pinnedcommands extended with--formula/--caskswitches;upgrade/uninstall/reinstallskip pinned casks (with summaries/warnings);bundleexcludes pinned casks from outdated/greedy checks.- Documentation, manpage, and bash/zsh/fish completions updated to reflect the new behavior and switches.
Reviewed changes
Copilot reviewed 38 out of 38 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| Library/Homebrew/cask/cask.rb | Adds pin/unpin/pinned?/pinnable?/pinned_version/pin_path APIs and includes pin state in to_h/outdated_info. |
| Library/Homebrew/cask/upgrade.rb | Filters pinned casks out of upgrades and reports them via summary/opoo/ofail. |
| Library/Homebrew/cask/uninstall.rb | Refuses to uninstall pinned casks unless forced (then unpins). |
| Library/Homebrew/cask/migrator.rb | Moves the cask pin symlink when migrating to a new token. |
| Library/Homebrew/cask/info.rb | Emits the new pinned-cask metadata line in cask info output. |
| Library/Homebrew/cmd/pin.rb | Accepts casks, adds --formula/--cask, warns on auto_updates true. |
| Library/Homebrew/cmd/unpin.rb | Accepts casks via the same new switches. |
| Library/Homebrew/cmd/list.rb | Rewrites --pinned to combine formulae+casks; drops --pinned/--cask conflict. |
| Library/Homebrew/cmd/upgrade.rb | Adds pinned_casks to FinalUpgradeSummary and renders a new pinned-cask section. |
| Library/Homebrew/cmd/uninstall.rb | Refuses to zap pinned casks unless forced. |
| Library/Homebrew/cmd/reinstall.rb | Skips pinned casks in reinstall with an error message. |
| Library/Homebrew/cmd/info.rb | Renames formula_pinned_time to generic pin_path_mtime and emits cask pin metadata. |
| Library/Homebrew/bundle/cask.rb | Excludes pinned casks from outdated/greedy bundle checks. |
| Library/Homebrew/mcp_server.rb | Updates upgrade description string to match new wording. |
| Library/Homebrew/startup/config.rb (+ test stub) | Defines HOMEBREW_PINNED_CASKS. |
| Library/Homebrew/test/* | Adds specs for pinning/unpinning, list, info, upgrade summary, reinstall/uninstall guards, migrator, bundle behavior. |
| Library/Homebrew/test/support/fixtures/cask/everything*.json | Adds pinned/pinned_version fields. |
| Library/Homebrew/test/spec_helper.rb | Cleans up HOMEBREW_PINNED_CASKS between tests. |
| docs/Manpage.md, docs/FAQ.md, docs/Versions.md, manpages/brew.1 | Documentation updates for cask pinning. |
| completions/bash/brew, completions/fish/brew.fish, completions/zsh/_brew | New --formula/--cask completions and updated descriptions for pin/unpin/list/upgrade. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
45f7542 to
f714764
Compare
- `brew pin` should cover casks now that upgrades skip both package types. - Cask pin records keep list, info and upgrade output consistent. - `auto_updates true` casks need a warning because app updaters bypass Homebrew.
f714764 to
4e6fb1f
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.
brew pinshould cover casks now that upgrades skip both package types.auto_updates truecasks need a warning because app updaters bypass Homebrew.Fixes #12425
Fixes #11860
Fixes #4898
brew lgtm(style, typechecking and tests) with your changes locally?OpenAI Codex 5.5 xhigh with local review and testing