249 Commits

Author SHA1 Message Date
J Rob Gant
91df36e67c
Check for both shallow clones at the same time. 2020-12-10 11:14:30 -05:00
Mike McQuaid
9d90ef29eb
cmd/update: improve shallow clone message. 2020-12-07 15:23:08 +00:00
Mike McQuaid
10e73164f0
update.sh: refuse to update shallow homebrew-core/cask clones.
GitHub has requested this as these are extremely expensive operations.
2020-12-03 08:42:09 +00:00
Maxim Belkin
2aecfe60fc Update logic that handles HOMEBREW_GIT_PATH. 2020-11-25 16:08:57 -06:00
Maxim Belkin
c3231a4095
Apply Mike's suggestions
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2020-11-25 12:54:18 -06:00
Mike McQuaid
fd08ffdd67
cmd/update.sh: update Git logic.
Co-authored-by: Maxim Belkin <maxim.belkin@gmail.com>
2020-11-25 08:44:40 +00:00
Maxim Belkin
82ad6a56e9
Address review comments. 2020-11-24 21:01:22 -06:00
Maxim Belkin
7c4b1841bc
Use set -e/set +e instead of odie 2020-11-20 18:02:22 -06:00
Maxim Belkin
22bc5a94e7
Properly handle outdated cURL
`HOMEBREW_CURL_PATH` has an effect only when `HOMEBREW_DEVELOPER` is set. However, the part of `brew.sh` that prints a message about outdated cURL disregards the value of `HOMEBREW_DEVELOPER`, which leads to a misleadnig message telling the user that `HOMEBREW_CURL_PATH` is outdated even though another cURL was used/tested.

This PR fixes it and instructs Homebrew to:

1. Display a warning message when system cURL is outdated and either `HOMEBREW_CURL_PATH` **or `HOMEBREW_DEVELOPER`** are not set. New `HOMEBREW_CURL_WARNING` variable is set to display the above warning only once (useful when `brew` calls itself internally).
2. Display `Installing Homebrew cURL` before auto-installing cURL in `update.sh` (due to `HOMEBREW_FORCE_BREWED_CURL`) and stop/exit if this step fails.
3. Display `Installing Homebrew Git` before auto-installing Git in `update.sh` (due to `HOMEBREW_FORCE_BREWED_GIT`) and stop/exit if this step fails.
2020-11-19 10:14:10 -06:00
Mike McQuaid
2bdf3deb6f
Reduce shallow clone usage
GitHub has requested we request our usage of shallow clones. As a
result:

- do default to shallow clones on CI
- do not do --shallow-since when setting up new repositories in
  `brew update`
- do not support shallow clones of homebrew-core at all

We may consider in future unshallowing all clones unconditionally.
2020-10-09 09:57:04 +01:00
shcai97
1789c27b32
use --key and --numeric-sort
Co-authored-by: Maxim Belkin <maxim.belkin@gmail.com>
2020-09-09 10:21:46 +08:00
shcai97
77f2a24a6b use sort to fix latest_tag 2020-09-09 01:12:58 +08:00
shcai97
249e8e29f9 fix latest_tag in homebrew/brew update 2020-09-08 10:41:45 +08:00
Mike McQuaid
0be15fc4b7
Run brew update before brew bundle.
This should help with cases like
https://github.com/Homebrew/homebrew-bundle/issues/751
and is good practise in general.

Also, document the `brew update --preinstall` flag that is being used
here so others can run it manually e.g. as part of CI if needed.
2020-07-28 11:49:52 +01:00
Caleb Xu
a53c92bd7f Cache commands list for faster shell completions 2020-06-18 11:06:31 -04:00
Shaun Jackman
b5584fc035 update: Update the symbolic ref origin/HEAD 2020-06-16 23:20:04 -07:00
Maxim Belkin
328c75fc33
Move logic related to HOMEBREW_RUBY_PATH to utils/ruby.sh 2020-05-15 10:30:45 -05:00
Maxim Belkin
1cba5821fd
cmd/update.sh: define conditions for unsetting HOMEBREW_RUBY_PATH 2020-05-12 11:50:12 -05:00
Maxim Belkin
9124e07b54
cmd/update.sh: keep HOMEBREW_RUBY_PATH set when updating 2020-05-11 10:47:03 -05:00
Mike McQuaid
3381cbf5c7
Use Homebrew::EnvConfig. 2020-04-07 09:58:26 +01:00
Mike McQuaid
79bc4f1136
update: make git rebase quiet on Mojave system Git.
Fix regression from https://github.com/Homebrew/brew/pull/7260.

This code makes me sad.
2020-04-03 08:59:11 +01:00
Mike McQuaid
fe5717519c
update: make rebase quiet.
I tested the workaround with the newest Git and the Catalina system Git
and it wasn't needed in either case. We can re-add it if we get
complaints with supported Git versions.

Fixes https://github.com/Homebrew/brew/issues/7259
2020-04-02 09:00:25 +01:00
Mike McQuaid
59958777c1
update: allow setting Git name and email.
This is needed for `brew test-bot` when no global Git configuration is
present.
2020-02-12 20:00:14 +00:00
Mike McQuaid
2f39057243
Improve handling of *_GIT_REMOTE env vars
- Output a message whenever a non-default remote is set.
- Ensure that `CoreTap.instance.install` uses the right remote.
2020-01-13 09:43:02 +00:00
Mike McQuaid
cfe2f5bfda
Merge remote-tracking branch 'origin/master' into add_change_origin_command 2019-12-30 10:39:28 +00:00
Mike McQuaid
355626ac51
Tweak/fix Git remote configuration behaviour. 2019-12-30 10:38:47 +00:00
EricFromCanada
2f7c3afeb8 cmd: improve wording of messages, spacing 2019-12-15 00:04:45 -05:00
hyuraku
e6e0d1128c create new envoronments 2019-12-03 00:45:11 +09:00
Mike McQuaid
8ff2e9ae4e
Improve speed of HOMEBREW_AUTO_UPDATE_SECS
This variable allows a user to configure how often `brew update` runs.
With the previous implementation, however, it was still pretty slow as
it would run some of `brew update` even within the timeout. This feels
related to complaints about Homebrew "feeling slow" since we enabled
this. Address this by:

- making `HOMEBREW_AUTO_UPDATE_SECS` behave more like
  `HOMEBREW_NO_AUTO_UPDATE` and entirely skip the invocation of
  `brew update` if the relevant tap (homebrew-core or homebrew-cask
  depending on command invoked) has been checked in the last
  `HOMEBREW_AUTO_UPDATE_SECS`
- Only require/check the update of a single tap rather than every tap
- Increase the default value of `HOMEBREW_AUTO_UPDATE_SECS` from 1m
  to 5m to cut people a bit more slack. We're not updating things
  often enough for 1m not to feel a bit overkill and 5m feels
  appropriate for a Homebrew "session" to only require a single update.
2019-10-03 12:54:34 +01:00
EricFromCanada
8a8359cdd4 manpages: sentence rewording for readability
Use active voice when applicable, better verbs & adjectives, preposition usage, proper tense, etc.
2019-08-20 09:05:45 -04:00
EricFromCanada
ee314617f7 manpages: update command usage strings 2019-08-20 08:55:54 -04:00
EricFromCanada
fa6404e0f5 grammar fixes 2019-04-13 21:29:32 -04:00
Mike Miller
fcd712eb58 update: make --help consistent, add options
Document short options and common global options. Apply the same indent
as other command help strings.
2019-03-16 23:12:17 -07:00
Mike Miller
e3ec8a7d47 update: add -f short option alias for --force 2019-03-16 23:11:16 -07:00
Mike McQuaid
9b682da37b
Use Homebrew/linuxbrew-core
This would allow the Linuxbrew core tap to live in the Homebrew
organisation.
2019-02-25 14:21:13 +00:00
Mike McQuaid
e7ce5dddb7
update: recommend 'brew untap` if tap doesn't exist.
We removed a few old, deprecated repos recently and people with them
still tapped who get confused at the `brew update` error message.
2019-02-16 19:57:56 +00:00
Mike McQuaid
172326a0cf
update: improve --help formatting. 2019-01-30 21:38:46 +00:00
Mike McQuaid
b2614ddcb6
update: make git rebase be quiet.
`--quiet` doesn't seem to be working as expected.
2019-01-12 11:55:06 +00:00
Mike McQuaid
170c5493a4
Update deprecations
- Add some `odeprecated`
- Make some `odeprecated` now `odisabled`
- Remove `odisabled` code.
- Remove old update migrations
- Remove GCC 4.0 compiler
- Remove Tiger-only code
- Remove 32-bit-only code
- Remove use of LD64
- Remove GCC 4.3 - 4.8 support.
2019-01-08 19:13:46 +00:00
Mike McQuaid
9aee39825d
update: also update master when updating stable branch. 2018-11-25 20:16:13 +00:00
EricFromCanada
e20ccfdb53 update: change repo remotes to HTTPS if possible
Older systems will install Homebrew via git://, but can switch to https:// if a newer curl is installed.
2018-11-14 16:44:35 -05:00
Mike McQuaid
51af87f85f
Add HOMEBREW_FORCE_HOMEBREW_ON_LINUX
This serves a similar purpose to the HOMEBREW_FORCE_HOMEBREW_ORG
variable but applies to more settings.
2018-10-20 13:58:27 +01:00
Mike McQuaid
4feb851279
Fix brew style shellcheck warnings. 2018-10-07 22:08:59 +01:00
Shaun Jackman
fdcdf7cb5c CoreTap.default_remote: Use Linuxbrew/core [Linux] 2018-10-02 15:44:30 -07:00
Chongyu Zhu
cc0f17eb7b
cmd/update: make curl respect HOMEBREW_CURLRC 2018-09-14 18:50:21 +08:00
Mike McQuaid
dc7b73171c
cmd/update: follow GitHub API redirects.
Fixes #4867
2018-09-09 17:55:09 +01:00
Markus Reiter
bdc2458c15 Always fetch at least the latest tag. 2018-08-11 00:46:29 +02:00
Jack Haden-Enneking
e63feb79f9
Simplify check before git install
No need to check for both variables, because they're always set together.
Also, this harmonizes with the CURL equivalent just above.
2018-06-26 11:14:32 -07:00
Jack Haden-Enneking
9fd5a92ff6 Implement HOMEBREW_FORCE_BREWED_GIT
Because of this messing with the user's path:
https://github.com/Homebrew/brew/blob/
    efc02899c851c62c9ce0d15dea9a231575d7d774/bin/brew#L68
brew uses /usr/bin/git over brewed git, even when the former is
problematically old.
There may also be other reasons a user prefers to use brewed git.

There was already a HOMEBREW_FORCE_BREWED_CURL option and a
HOMEBREW_SYSTEM_CURL_TOO_OLD check to set it. This mostly copies those
to implement HOMEBREW_FORCE_BREWED_GIT & HOMEBREW_SYSTEM_GIT_TOO_OLD.

See also: https://github.com/Linuxbrew/brew/issues/736
2018-06-25 23:36:12 -07:00
Eli Young
8734848829 Support enabling auto-updates for non-GitHub taps 2018-04-24 11:10:48 -07:00