### Background
Given a repo that does not have branch named `master` and a formula like this:
```ruby
class Example < Formula
stable do
url "https://github.com/user/example.git", revision: "e8b123de62e0faec283c3253c6ea5495a332007e"
end
end
```
Homebrew was executing this when the cached location did not exist:
```
git clone https://github.com/user/example.git /path/to/cache
```
(which would work)
and this when the cached location did exist:
```
git -C /path/to/cache config remote.origin.fetch +refs/heads/master:refs/remotes/origin/master
git -C /path/to/cache fetch origin
```
(which would always fail with `fatal: couldn't find remote ref refs/heads/master`)
This commit changes the value for `remote.origin.fetch` to `+refs/heads/*:refs/remotes/origin/*` which is [Git's default value for the refspec](https://git-scm.com/book/en/v2/Git-Internals-The-Refspec) anyway.
This may increase the latency of `git fetch origin` for formulae that use `:revision` because Git will now fetch all remote refs; but it does have the advantage of not being broken 🙂
- `download_strategy`: only request image index JSON for downloading
the manifest for the tab
- use a shared `OS` constant for the version of `glibc` we use in CI
- fix `skoepeo` typo
- ensure that blank hash values are deleted (again) rather than just
`nil` ones
- use a shared `Hardware::CPU` constant for oldest CPU we're
supporting/using on Intel 64-bit
- re-add comment to `software_spec`
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
local bottle file.
`skopeo` allows replacing `docker` and `oras` with a single tool that
behaves in a way that's a little more intuitive for us (we build the
directory structure on disk and upload that). It seems to be better at
preserving our metadata, too.
Take the opportunity for writing out more metadata ourselves to split
out more logic into separate functions.
While we're here, fix the `download_strategy` timeout handling for
GitHub Packages.