Currently, doing `brew update-reset homebrew/core` does nothing (not
even return an error). If you want to `update-reset` a given tap, you
must do (the equivalent of)
brew update-reset "$(brew --repository owner/tap_name)"
This isn't very intuitive, so let's do a bit more work in argument
parsing so that the user can just pass a tap name instead of a path to a
tap.
Passing a path to a tap is also still supported.
Otherwise, a global `core.symlinks = false` setting, likely in a WSL context, breaks Aliases and any other places that use symlinks.
Also enforce consistency in `git config` settings across instances.
Ref: https://github.com/Homebrew/homebrew-core/issues/112539
Current situation with update.sh & update-reset.sh:
Upon creating a new tap and before adding remote 'origin' to it,
running `brew update` produces multiple cryptic error messages.
This change converts these cryptic Git messages into clear warnings
about absent remote 'origin'.
How to test:
1. Create a new tap using `brew tap-new`
2. Run `brew update`
Git is a transport and storage mechanism for us so we don't want to
allow arbitrary customisation of this due to user issues e.g. #3664
and #3561.
Fixes#3664.
Add new `brew update-reset` command to provide a helpful troubleshooting
fallback to fetch and reset all repositories. This could have lived in
`brew update` but it makes sense to avoid the complexity of sharing
logic between these scripts and keeping this one simpler.