Repository navigation
Uninstall asks about the Brewfile entry; new casks follow the file's greedy style - #2
Merged
Merged
Conversation
…greedy style Uninstall in the Brewfile view ran `brew uninstall` and kept the entry, so taking a package off the Mac and out of the Brewfile took two actions. For one package or a selection, it now asks: Uninstall and Remove from Brewfile, or Uninstall, Keep in Brewfile. Only the packages brew actually uninstalled lose their entries, so a failed or stopped uninstall leaves the Brewfile as it was. The removal is one undoable edit. The Installed view lists only packages not in the Brewfile, so its bulk Uninstall is unchanged. A cask Barkeep adds now gets `greedy: true` when most of the Brewfile's casks carry it, and stays bare otherwise. Barkeep follows the file rather than knowing about mrk. mrk's Brewfile puts it on every cask, and before this each cask added here was the odd one out, to be fixed by hand. BrewfileViewModel gains remove(packages:), matching by name and kind, and newCasksAreGreedy; BrewfileEntry gains isGreedy and a greedy argument to canonicalLine. Six tests cover add with greedy and bare Brewfiles and one with no casks, what isGreedy reads, and removal by name and kind when a formula and a cask share a name. The help window and README describe both. Draft notes are in release-notes/v1.13.0.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Uninstall can remove the Brewfile entry too
In the Brewfile view, Uninstall… (for one package or a selection) now opens a dialog with three choices:
Before, Uninstall always kept the entry, so removing a package from both the Mac and the Brewfile took two actions.
brewactually uninstalled lose their entries. A failed or stopped uninstall leaves the Brewfile as it was.New casks match the file's
greedy: truestyleadd()writescask "name", greedy: truewhen most of the Brewfile's casks already carry it, and a bare line otherwise. Barkeep follows the file rather than checking whether the Brewfile is mrk's. In mrk's Brewfile every cask carries it, and each cask Barkeep added was the odd one out, which had to be fixed by hand.Code
BrewfileEntry.isGreedy;canonicalLine(name:kind:greedy:).BrewfileViewModel.newCasksAreGreedy;remove(packages:brewfileURL:), which matches by name and kind.uninstallEachnow returns the packages it uninstalled. Its log and notification say "uninstalled" rather than "removed", which now means something else.release-notes/v1.13.0.mdis a draft. I assumed 1.13.0 because these are two new features; rename the file if the version you release is different.Tests
36 pass locally with
xcodebuild … test(30 existing, 6 new), with no new warnings. The new tests cover:greedy: true;isGreedycounts as greedy;Not tested by hand: I didn't click through the dialog in the running app. That would have run real
brew uninstallcommands against your real Brewfile.Related
add()follows the new behaviour, and BIN-1, manual.md and the cleanup skill mention it (Follow Barkeep 1.13.0: greedy casks, and Uninstall and Remove from Brewfile mrk#29).Those two describe 1.13.0 by version number, so merge them once this ships.
🤖 Generated with Claude Code