`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.
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.
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.
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
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.
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