225 Commits

Author SHA1 Message Date
Dustin Rodrigues
b776fb32de
change includecount to include_count for readability 2023-03-20 07:23:17 -04:00
Dustin Rodrigues
e5fba88035
use includecount argument in pluralize 2023-03-19 23:35:47 -04:00
Douglas Eichelberger
0eccc0e987 git grep -l Utils::Inflection | xargs gsed -i 's|Utils::Inflection|Utils|g' 2023-02-27 20:18:27 -08:00
Douglas Eichelberger
3da68651e5 Port more call sites 2023-02-27 20:18:08 -08:00
Bo Anderson
e86a8c2477
Move HOMEBREW_NO_INSTALL_FROM_API defaults to shell 2023-02-24 21:53:08 +00:00
Mike McQuaid
f280ce069b
Support loading formulae/casks from subdirectories
Previously, we required all formulae and casks to be in a specific
formula or cask directory but did not check any subdirectories.

This commit allows using subdirectories for official taps, the only
ones likely to be big enough to warrant sharding in this way and to
avoid potentially breaking backwards compatibility for existing taps.

This was inspired by the most recent issues with homebrew-cask.
2023-02-24 10:57:41 +00:00
Mike McQuaid
53c57d7a70
tap: return the default_remote if not installed.
Fixes #14656.
2023-02-16 12:25:28 +00:00
Bo Anderson
7ef0c48362
Fix analytics handling when core/cask taps are untapped 2023-02-15 05:31:08 +00:00
Mike McQuaid
4c8ed77302
Improve homebrew/{core,cask} autotapping.
Don't automatically tap these when running a developer command that's
not using the API.

Fixes #14606
2023-02-14 09:54:24 +00:00
EricFromCanada
dfc9906184
internal messaging fixes 2023-02-10 23:17:16 -05:00
Asutosh Palai
a3765d0a80 making core tap install an in-process call
This helps fixes problems with fresh install on ARM Linux.
When brew is relaunched with filtered PATH, it is not able to
find user installed Ruby.
2023-02-03 00:36:39 +00:00
Mike McQuaid
fd18c7b0ac
Tweak cask-source API handling
- Use raw.githubusercontent.com to download cask source rather than
  formulae.brew.sh. This allows us to remove these files
- output the tap's current `HEAD` for both formulae and cask JSON
- use this `HEAD` for the cask-source API to get the exact file on
  raw.githubusercontent.com rather than just whatever is newest (which
  is what the previous API did)
- set the `Tap` correctly when creating a `Cask` from the API
- if the `formula.json` file exists: print its modified time include
  `brew config`
- memoize `tap.git_head` as we'll be calling it a lot in the same
  process with the same value
2023-01-26 17:36:40 +00:00
Rylan Polster
cc615ef7fb
Fix brew search for HOMEBREW_INSTALL_FROM_API 2023-01-23 13:32:54 -05:00
Mike McQuaid
59f4b5226a
tests: test on Ubuntu 18.04. 2022-11-09 14:45:43 +00:00
Mike McQuaid
e2759fbdff
Deprecate reading all formulae through commands
We added the `--all` flag (now renamed to `--eval-all`) for various
commands for this behaviour so let's start deprecating this.

Also, introduce a `HOMEBREW_EVAL_ALL` environment variable to use the
existing, less secure, behaviour by default and avoid passing
`--eval-all` everywhere.
2022-09-05 13:57:22 +01:00
Bo Anderson
677bb92ba9
tap: add versioned_formula_files 2022-08-25 15:05:26 +01:00
Mike McQuaid
6b697470fd
brew style --fix
For https://github.com/Homebrew/brew/pull/13671
2022-08-10 14:19:33 +01:00
Bo Anderson
1d36c42fb7
Support offline usage under HOMEBREW_INSTALL_FROM_API 2022-06-14 16:06:05 -04:00
xxyzz
2e899da7c7
Add --no-force-auto-update option to brew tap
Enable this option to delete `homebrew.forceautoupdate` git config option
2022-05-11 07:17:17 +08:00
xxyzz
0bade72bc0
Don't print set git credential cache message if a helper exists
for the tapped private repository
2022-04-11 20:57:43 +08:00
EricFromCanada
2fdc70c3bf
desc, search: also search cask descriptions 2022-03-30 11:23:55 -04:00
Mike McQuaid
79891a7103
Update uses of Formula.all/Cask::Cask.all
Add some `--all` flags we'll eventually migrate to to ensure that we'll
eventually require their usage to read all formulae. Where we need to
do stuff later, add some comments.
2022-03-08 19:24:56 +00:00
Bo Anderson
6fa70337e3
Fix linuxbrew-core migration not applying to Linuxbrew/homebrew-core 2021-12-11 22:35:42 +00:00
Mike McQuaid
d43555dd75
brew style --fix 2021-11-02 11:16:10 +00:00
Rylan Polster
0b8032d421
Document HOMEBREW_INSTALL_FROM_API 2021-10-22 12:37:57 -04:00
Rylan Polster
fa4bb7d74a
Refactor audit exception handling 2021-10-21 21:11:05 -04:00
Michka Popoff
1cc7ca33c0
update: migrate everyone from linuxbrew-core to homebrew-core
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-10-20 11:01:38 +01:00
XuehaiPan
33f9cab3c6 tap: handle brew tap homebrew/core without a URL while HOMEBREW_CORE_GIT_REMOTE set 2021-10-13 19:52:44 +08:00
XuehaiPan
cfc1821e2c tap: fix unexpected wrong variable name 2021-10-12 21:58:40 +08:00
XuehaiPan
2be19d8f06 tap: remove "rubocop:disable" comment 2021-10-12 20:43:36 +08:00
Xuehai Pan
889b30b32e tap: apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-10-12 20:43:20 +08:00
Xuehai Pan
3dcfc7e26e tap: apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-10-12 20:43:20 +08:00
XuehaiPan
63f2f6cca7 tap: allow to change tap remote with brew tap --custom-remote 2021-10-12 01:11:34 +08:00
Mike McQuaid
41e94afda5
Fix brew style
Fixes for https://github.com/Homebrew/brew/pull/12152.

Extracted into a separate PR so this can be merged immediately.
2021-09-30 10:13:53 +01:00
Rylan Polster
5d536d66fc
Rename HOMEBREW_JSON_CORE to HOMEBREW_INSTALL_FROM_API 2021-08-27 00:24:15 -04:00
Alexander Bayandin
7aacda1754
formula: add fuzzy_search method 2021-06-22 18:06:52 +01:00
Rylan Polster
60203afdd5
Merge env variables into HOMEBREW_JSON_CORE 2021-06-18 12:10:26 -04:00
Rylan Polster
1d516b628b
Use #present? and #blank? to check env variable 2021-06-18 12:07:34 -04:00
Rylan Polster
2760d981d3
Allow for homebrew/core to be untapped 2021-06-17 14:18:43 -04:00
Connor Mann
a7ca15d8e9 Override user-set default git template 2021-05-14 10:47:52 -04:00
cnnrmnn
0b5f440cfc Remove reference to full_clone in CoreTap 2021-05-07 16:47:58 -04:00
cnnrmnn
b5569ffd33 Remove full_clone from CoreTap 2021-05-07 16:47:58 -04:00
cnnrmnn
674594f75c Stop using shallow clones for taps 2021-05-06 10:10:56 -04:00
Zach Auten
95c8f445fa Fix bump-formula-pr for taps with ssh remote url. 2021-04-22 22:02:09 -04:00
Rylan Polster
0b214da4eb
tap: cleanup remote_repo method
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-03-22 08:54:38 -04:00
Rylan Polster
4e61f61a20
utils/github: handle non-standard tap remotes 2021-03-21 12:35:45 -04:00
Mike McQuaid
dc1fdc9f8d
Speedup brew --version.
Port `brew --version` to Bash to speed it up.

While we're here:
- remove (now) unused `Tap` Git methods
- use `--quiet` instead of `-q` to be more verbose

Benchmarks:
```
$ hyperfine --min-runs=3 --warmup=2 "git checkout origin/master; brew --version" "git checkout speedup_brew_version; brew --version"
Benchmark #1: git checkout origin/master; brew --version
  Time (mean ± σ):      2.083 s ±  0.004 s    [User: 396.8 ms, System: 597.2 ms]
  Range (min … max):    2.080 s …  2.088 s    3 runs

Benchmark #2: git checkout speedup_brew_version; brew --version
  Time (mean ± σ):     847.9 ms ±  35.2 ms    [User: 100.0 ms, System: 247.9 ms]
  Range (min … max):   824.1 ms … 888.3 ms    3 runs

Summary
  'git checkout speedup_brew_version; brew --version' ran
    2.46 ± 0.10 times faster than 'git checkout origin/master; brew --version'
```
2021-03-04 12:59:42 +00:00
nandahkrishna
56e0c3d9e8
Update GitHub API usage 2021-02-15 22:38:27 +05:30
Gibson Fahnestock
0f48498ad8
fix(tap): set clone remote name to origin explicitly
Git now allows setting a different default remote name than `origin`
when you do a fresh clone by running:

```shell
git config --global clone.defaultRemoteName notorigin
```

This causes `brew tap <tap_name> && brew update` to fail, as it clones
with a different remote name in the `tap` and then expects the remote to
be `origin` in the `update`.

Fix this by explicitly setting the origin remote in the clone command.
2021-02-09 15:29:54 +00:00
Rylan Polster
84fc16c1c1
Apply suggestions from code review
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
2021-01-28 09:10:14 -05:00