From b2c7d6d83d0eecba7057873b7cb3511d09183825 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 17 Sep 2016 19:41:21 +0100 Subject: [PATCH 1/2] update.sh: update to latest Homebrew/brew tag. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rather than following every change on `master` let’s have non-developer users (i.e. those who have never run a `dev-cmd` or set `HOMEBREW_DEVELOPER`) update between tags. This provides a fairly natural beta (the `master` branch`) and stable (the tags) approach without restricting us to any particular way of managing our tags. --- Library/Homebrew/cmd/update.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index acf4520ba6..570a4c36bd 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -215,7 +215,18 @@ merge_or_rebase() { trap reset_on_interrupt SIGINT - REMOTE_REF="origin/$UPSTREAM_BRANCH" + if [[ "$DIR" = "$HOMEBREW_REPOSITORY" && -z "$HOMEBREW_NO_UPDATE_CLEANUP" ]] + then + UPSTREAM_TAG="$(git tag --list --sort=-version:refname | head -n1)" + fi + + if [ -n "$UPSTREAM_TAG" ] + then + REMOTE_REF="refs/tags/$UPSTREAM_TAG" + UPSTREAM_BRANCH="v$UPSTREAM_TAG" + else + REMOTE_REF="origin/$UPSTREAM_BRANCH" + fi if [[ -n "$(git status --untracked-files=all --porcelain 2>/dev/null)" ]] then From e8ebcb834bcd54aa555b52cc6a06bf05e8b5ac1a Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 18 Sep 2016 19:59:56 +0100 Subject: [PATCH 2/2] update.sh: allow forcing tag update. To test the tag update functionality allow setting `HOMEBREW_UPDATE_TO_TAG`. --- Library/Homebrew/brew.sh | 2 +- Library/Homebrew/cmd/update.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index fc2e6993c5..e82f7098a5 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -1,4 +1,4 @@ -HOMEBREW_VERSION="0.9.9" +HOMEBREW_VERSION="1.0.0" onoe() { if [[ -t 2 ]] # check whether stderr is a tty. diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index 570a4c36bd..eb15e10291 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -348,7 +348,7 @@ EOS set -x fi - if [[ -z "$HOMEBREW_UPDATE_CLEANUP" ]] + if [[ -z "$HOMEBREW_UPDATE_CLEANUP" && -z "$HOMEBREW_UPDATE_TO_TAG" ]] then if [[ -n "$HOMEBREW_DEVELOPER" || -n "$HOMEBREW_DEV_CMD_RUN" ]] then