There are plenty of IO operations inside Tap object, and it will be more
when implementing formula alias reverse look up(e.g. list all of alias
names for a formula). So let's cache them.
Some benchmark:
$ time brew info $(brew ruby -e 'puts Formula.tap_names') > /dev/null
Before: 6.40s user 2.42s system 96% cpu 9.134 total
After: 4.75s user 0.77s system 97% cpu 5.637 total
ClosesHomebrew/homebrew#44377.
Signed-off-by: Xu Cheng <xucheng@me.com>
`brew tap` restricts users to GitHub and checks for private repos. I
created `brew any-tap` to support a wider variety of taps.
With very small changes (and no extra flags!), this change allows users
to use `brew tap` with GitHub as they always have or add one extra
argument and tap any repository of any type from anywhere.
brew tap user/name # Same as it ever was
brew tap user/name URL # Tap URL, whatever it happens to be
ClosesHomebrew/homebrew#40326.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
`brew untap` without arguments currently errors out (as it should), but the
error message is generic and unhelpful. (The error message is borrowed from
a method in the tap command - `tap_args`.)
ClosesHomebrew/homebrew#18186.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
We allow homebrew/dupes for instance, rather than Homebrew/dupes. Because nobody likes shifting in the terminal.
In the process of doing this I discovered some case-insensitive filesystem bugs we have avoided before because I had the foresight to mandate lowercase in formula names. GitHub considers Homebrew and homebrew to be different (even though you can't create both). So we had to allow case insensitivity in tap input. I have made it now so the resulting directory however is lowercased, neatly avoiding the issue. And so we also downcase tap arguments when applying them to tap directories or formula.
The symlinks taps write to Formula show up in git status, but this trick prevents this. brew-(un)tap maintain a .gitignore in Formula that contains all the symlinks brew-tap creates.
We add the .gitignore to the root .gitignore and TADA! Magic.