Merge pull request #4932 from MikeMcQuaid/update-reset-repos

update-reset: allow specifying repositories.
This commit is contained in:
Mike McQuaid 2018-09-18 21:36:26 +01:00 committed by GitHub
commit 7c4b9f2274
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 14 deletions

View File

@ -1,10 +1,11 @@
#: * `update-reset`:
#: Fetches and resets Homebrew and all tap repositories using `git`(1) to
#: their latest `origin/master`. Note this will destroy all your uncommitted
#: or committed changes.
#: * `update-reset` [<repositories>]:
#: Fetches and resets Homebrew and all tap repositories (or the specified
#: `repositories`) using `git`(1) to their latest `origin/master`. Note this
#: will destroy all your uncommitted or committed changes.
homebrew-update-reset() {
local DIR
local -a REPOS=()
for option in "$@"
do
@ -15,10 +16,7 @@ homebrew-update-reset() {
[[ "$option" = *d* ]] && HOMEBREW_DEBUG=1
;;
*)
odie <<EOS
This command updates brew itself, and does not take formula names.
Use 'brew upgrade <formula>'.
EOS
REPOS+=("$option")
;;
esac
done
@ -28,7 +26,12 @@ EOS
set -x
fi
for DIR in "$HOMEBREW_REPOSITORY" "$HOMEBREW_LIBRARY"/Taps/*/*
if [[ -z "$REPOS" ]]
then
REPOS+=("$HOMEBREW_REPOSITORY" "$HOMEBREW_LIBRARY"/Taps/*/*)
fi
for DIR in ${REPOS[@]}
do
[[ -d "$DIR/.git" ]] || continue
cd "$DIR" || continue

View File

@ -578,10 +578,10 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
If `--force` (or `-f`) is specified then always do a slower, full update check even
if unnecessary.
* `update-reset`:
Fetches and resets Homebrew and all tap repositories using `git`(1) to
their latest `origin/master`. Note this will destroy all your uncommitted
or committed changes.
* `update-reset` [`repositories`]:
Fetches and resets Homebrew and all tap repositories (or the specified
`repositories`) using `git`(1) to their latest `origin/master`. Note this
will destroy all your uncommitted or committed changes.
* `upgrade` [`install-options`] [`--cleanup`] [`--fetch-HEAD`] [`--ignore-pinned`] [`--display-times`] [`formulae`]:
Upgrade outdated, unpinned brews (with existing install options).

View File

@ -527,7 +527,7 @@ If \fB\-\-merge\fR is specified then \fBgit merge\fR is used to include updates
If \fB\-\-force\fR (or \fB\-f\fR) is specified then always do a slower, full update check even if unnecessary\.
.
.IP "\(bu" 4
\fBupdate\-reset\fR: Fetches and resets Homebrew and all tap repositories using \fBgit\fR(1) to their latest \fBorigin/master\fR\. Note this will destroy all your uncommitted or committed changes\.
\fBupdate\-reset\fR [\fIrepositories\fR]: Fetches and resets Homebrew and all tap repositories (or the specified \fBrepositories\fR) using \fBgit\fR(1) to their latest \fBorigin/master\fR\. Note this will destroy all your uncommitted or committed changes\.
.
.IP "\(bu" 4
\fBupgrade\fR [\fIinstall\-options\fR] [\fB\-\-cleanup\fR] [\fB\-\-fetch\-HEAD\fR] [\fB\-\-ignore\-pinned\fR] [\fB\-\-display\-times\fR] [\fIformulae\fR]: Upgrade outdated, unpinned brews (with existing install options)\.