Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotate formula with a --note keyword #13511

Closed
vsheg opened this issue Jul 4, 2022 · 5 comments
Closed

Annotate formula with a --note keyword #13511

vsheg opened this issue Jul 4, 2022 · 5 comments
Labels
features New features outdated PR was locked due to age

Comments

@vsheg
Copy link

vsheg commented Jul 4, 2022

Provide a detailed description of the proposed feature

brew install should provide functionality to annotate formulas and casks with a --note keyword:

$ brew install --cask --note LaTeX latexit

Also, a note can be added to an existing formula or cask:

$ brew upgrade --note LaTeX ghostscript

Then this annotation can be used to understand installation reason

$ brew list
==> Formulae
gcc
ghostscript [1]
[email protected]

⟹ Casks
latexit [1]

[1] LaTeX

Or to uninstall all formulas and casks annotated with it

$ brew uninstall --note LaTeX

What is the motivation for the feature?

  1. The number of installed formulas can be very large. It's hard to remember which formulas are needed, which are not and can be removed. The user loses control of their formulas.
  2. When switching to a new computer, I had to spend hours sorting out the formulas that I want to install on it, and which ones I don't need (I know how to check dependencies).
  3. Some formulas are needed only to do a specific task one time, they can be annotated as --note tmp and then easy deleted

How will the feature be relevant to at least 90% of Homebrew users?

This feature is relevant for 100% of Homebrew users, it's not something one needs to use every day, but it can provide organization for the working environment and bring clarity.

What alternatives to the feature have been considered?

  1. Tags — even more powerful, but more complicated abstraction
  2. Isolated environments — same, but solves only the "install, use, uninstall" problem
@vsheg vsheg added the features New features label Jul 4, 2022
@vsheg vsheg changed the title Annotate formula with a --note Annotate formula with a --note keyword Jul 4, 2022
@issyl0
Copy link
Member

issyl0 commented Jul 4, 2022

When switching to a new computer, I had to spend hours sorting out the formulas that I want to install on it, and which ones I don't need (I know how to check dependencies).

You might be interested in Homebrew/homebrew-bundle and the resulting Brewfile. You can leave comments in that file for why you have the packages installed, and migrating to a new computer is less manual work. (But, of course, it doesn't solve your "why is this dependency installed" question.)

@carlocab
Copy link
Member

carlocab commented Jul 4, 2022

Similarly, you might be interested in

brew uses --installed

and

brew autoremove

Do brew help uses and brew help autoremove for details.

@vsheg
Copy link
Author

vsheg commented Jul 5, 2022

@issyl0 @carlocab thank you, I think it solves 85% of my problems but still think that annotations may be useful and can be used in Brewfiles

Also, as feedback for Brewfiles, I would expect it works like a Python's poetry environment (or Rust's cargo, R's renv), i.e., any brew install (update, remove, etc.) will update Brewfile, so, Brewfile determines the environment in a current scope. As I understand, now, the way to work with it, it's just run brew bundle dump -f and brew bundle cleanup -f from time to time

@apainintheneck
Copy link
Contributor

Also, as feedback for Brewfiles, I would expect it works like a Python's poetry environment (or Rust's cargo, R's renv), i.e., any brew install (update, remove, etc.) will update Brewfile, so, Brewfile determines the environment in a current scope. As I understand, now, the way to work with it, it's just run brew bundle dump -f and brew bundle cleanup -f from time to time

There has been some discussion about adding those features to brew bundle in Homebrew/Homebrew-Bundle#818 but it looks like they have stalled out. I think the main thing is that since it is an optional brew subcommand there is no interest in modifying the behavior of brew install/uninstall directly though we are open to the idea of adding more options to brew bundle that allow you to install and add to your Brewfile for example.

@MikeMcQuaid
Copy link
Member

Passing on this, sorry. Will consider additions to Homebrew/homebrew-bundle#818 but note that we're not working on a PR for that so if you want to see it happen: you'll likely need to make one.

@MikeMcQuaid MikeMcQuaid closed this as not planned Won't fix, can't repro, duplicate, stale Jul 6, 2022
@github-actions github-actions bot added the outdated PR was locked due to age label Aug 6, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
features New features outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

5 participants