brew update and can still reproduce the problem?brew doctor, fixed all issues and can still reproduce the problem?brew config and brew doctor and included their output with your issue?I was looking for some solutions on my problem with brew, and found some commands started with brew bundle.
Well, I never do copy&paste, so first I wanted to know what is the bundle. So, I simply typed: brew help bundled and all this happened...
Command output
$ brew help bundle
==> Tapping homebrew/bundle
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-bundle'...
remote: Enumerating objects: 13, done.
remote: Counting objects: 100% (13/13), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 5158 (delta 4), reused 1 (delta 0), pack-reused 5145
Receiving objects: 100% (5158/5158), 1.15 MiB | 2.79 MiB/s, done.
Resolving deltas: 100% (3019/3019), done.
Tapped 1 command (104 files, 1.5MB).
Error: No Brewfile found
I expected to get some information about a command bundle. Now, I know I should use brew bundle --help. I won't argue if this is convenient or not.
However, let me answer what I did not expect: Auto installation of the bundle!
This definitely should never happed for a help command.
brew commands)brew help bundle
brew config and brew doctor commandsdoctor: Your system is ready to brew.
HOMEBREW_VERSION: 2.4.16 ORIGIN: https://github.com/Homebrew/brew HEAD: 2a4c9f610e69b9fed1eec61ac2c53e4b11a32e4c Last commit: 7 days ago Core tap ORIGIN: https://github.com/Homebrew/homebrew-core Core tap HEAD: 642b748a2f1029ee2afb0188a5ced5d543be4456 Core tap last commit: 2 hours ago Core tap branch: master HOMEBREW_PREFIX: /usr/local HOMEBREW_CASK_OPTS: [] HOMEBREW_MAKE_JOBS: 4 CPU: quad-core 64-bit haswell Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby Clang: 11.0 build 1103 Git: 2.28.0 => /usr/local/bin/git Curl: 7.64.1 => /usr/bin/curl macOS: 10.15.6-x86_64 CLT: 12.0.0.0.1.1597368733 Xcode: 11.7
Side comment: So how can I clean it up now? Just manually removing /usr/local/Homebrew/Library/Taps/homebrew/homebrew-bundle directory? There is no information how to uninstall this, and I never asked to install it.
bundle is an external command that comes from the homebrew-bundle tap. It lives in a separate repository so in order to use any of the bundle functionality you must tap (think git clone) the bundle repository. This includes seeing the help information which lives in the repository as well. Since bundle is an official tap, Homebrew automatically detects and "installs" it in order to show the help message.
So how can I clean it up now?
brew untap homebrew/bundle will remove bundle.
I agree, though, I don't think we should be automatically tapping things like this (even if they're official) because its unexpected for users. I'd, instead, suggest one of the following options when running brew help <cmd> where cmd comes from an external tap:
Tapping homebrew/<foo> to show help text for <cmd>. To untap, run brew untap homebrew/<foo>"homebrew/<foo>? This is necessary to display help test for <cmd> [Y/n]:"<cmd> you must tap homebrew/<foo> by running brew tap homebrew/<foo>@bartskowron do you, as a user, have a preference for any of the above options? I, as a maintainer, like the first option (tap and give instructions for how to untap)
However, automatic tapping was clearly added for a reason so I will differ to other maintainers if there's a good reason to keep it this way.
As I understood correctly, the reason to add automatic tapping was due to possibility to have a nice template for any possible tap that could be found at the moment. This behaviour can be kept by moving fetching of the taps to brew update command (which is supported and enabled AFAIK). Then the search should be done based on already cached information.
This would be understandable from user point of view.
As speaking about the proposed options, I'm definitely opting for the second option. I have no doubts about it. The first option is acceptable, however I can imagine to get mad if this would happened in some circumstances (e.g. expensive roaming costs).
The third option is very manual. You have to type a way more characters than just simply pressing Enter ;-)
Thanks for the detailed explanation. I appreciate it :ok_hand:
As I understood correctly, the reason to add automatic tapping was due to possibility to have a nice template for any possible tap that could be found at the moment. This behaviour can be kept by moving fetching of the taps to
brew updatecommand (which is supported and enabled AFAIK). Then the search should be done based on already cached information.
This would be understandable from user point of view.
Maybe I'm not understanding what you mean exactly here. The reason that bundle was tapped automatically was so that you could view the help text. It's assumed, I think, that a user typing brew help bundle already knows that they want to tap homebrew-bundle so it saves them any extra work. Once it's been tapped, brew update will continue to update it just as it does homebrew-core and homebrew-cask
As speaking about the proposed options, I'm definitely opting for the second option. I have no doubts about it.
Good input鈥攖hanks! I would point out that we don't use user input like this anywhere else (that I can think of), so its possible that adding that functionality only here would be frowned upon. I'm not sure if we have a specific reason for this (for example, to make brew work in scripts that won't be able to provide this input).
The first option is acceptable, however I can imagine to get mad if this would happened in some circumstances (e.g. expensive roaming costs).
Good point. Noted!
The third option is very manual. You have to type a way more characters than just simply pressing Enter ;-)
Totally agree
I would point out that we don't use user input like this anywhere else (that I can think of), so its possible that adding that functionality only here would be frowned upon. I'm not sure if we have a specific reason for this (for example, to make
brewwork in scripts that won't be able to provide this input).
Homebrew never prompts the user for anything except when escalating to root privileges.
It鈥檚 built that way with scriptability in mind.
I feel the key here is to meet user expectations.
People certainly don鈥檛 expect a help command to download things but neither is it supposed to _ask back_.
The first option is acceptable, however I can imagine to get mad if this would happened in some circumstances (e.g. expensive roaming costs).
@bartskowron The tap weighs about three megabytes, which is less than a single page of many websites. If a user is in situation where that鈥檚 a concern, they should certainly not interact with a package manager (which, by the way, also auto-updates).
Agreed with @claui's response. Closing, sorry.
Homebrew never prompts the user for anything except when escalating to root privileges.
It鈥檚 built that way with scriptability in mind.
Makes sense, thanks for the insight @claui
However, I do still think there's value in at least telling the user what is happening/how to untap. Any objections to adding a message like this to the output?
Actually, I'm going to reopen and repurpose this issue.
Running brew help bundle when homebrew-bundle isn't tapped does the following:
brew tap homebrew/bundlebrew bundle (which returns Error: No Brewfile found)Regardless of whether bundle is automatically tapped, the user should ultimately get the help text (which is what they asked for)
Expected:
brew tap homebrew/bundlebrew help bundleI find it strange that brew help X taps a repo. I think Homebrew should be failing if X command isn't available with an error message along the lines of Command X is not found. Please tap Z to install it. (which, I now see, is what @Rylan12 have proposed above in option 3). Everything will still be "scriptable".
Homebrew never prompts the user for anything except when escalating to root privileges.
It鈥檚 built that way with scriptability in mind.I feel the key here is to meet user expectations.
People certainly don鈥檛 expect a help command to download things but neither is it supposed to _ask back_.
Very good point! After rethinking, I agree that scriptability should be a priority here.
This actually moves me to opt for a third option then. No problem! Its still a great solution and win-win.
The first option is acceptable, however I can imagine to get mad if this would happened in some circumstances (e.g. expensive roaming costs).
@bartskowron The tap weighs about three megabytes, which is less than a single page of many websites. If a user is in situation where that鈥檚 a concern, they should certainly not interact with a package manager (which, by the way, also auto-updates).
I made a shortcut, sorry for confusing! I can imagine to get mad at the moment of noticing the download and probably will be fine AFTER I realize that it was only 3MB that I didn't know about in a moment of the downloading start.
It's not necessary, can be stressful.
I'll copy @MikeMcQuaid's response in https://github.com/Homebrew/brew/pull/8653#issuecomment-689082064 here as well:
These are "official external commands" so this behaviour is intentional. Perhaps they should/could be migrated to Homebrew/brew instead but until then allowing brew bundle or brew services to work without extra intervention is desirable.
Most helpful comment
I find it strange that
brew help Xtaps a repo. I think Homebrew should be failing if X command isn't available with an error message along the lines ofCommand X is not found. Please tap Z to install it.(which, I now see, is what @Rylan12 have proposed above in option 3). Everything will still be "scriptable".