From 2921795668970f9b5598037fc55940d29ba941d6 Mon Sep 17 00:00:00 2001
From: Mike McQuaid
Date: Fri, 22 Apr 2016 10:06:59 +0100
Subject: [PATCH] update: rebase (rather than merge) by default.
We want to always avoid merge commits being committed to Homebrew so
this feels like a better fit.
---
Library/Homebrew/cmd/update.sh | 9 +++++----
share/doc/homebrew/brew.1.html | 5 +++--
share/man/man1/brew.1 | 4 ++--
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh
index cc8d626088..29206b37f8 100644
--- a/Library/Homebrew/cmd/update.sh
+++ b/Library/Homebrew/cmd/update.sh
@@ -1,8 +1,9 @@
-#: * `update` [`--rebase`]:
+#: * `update` [`--merge`]:
#: Fetch the newest version of Homebrew and all formulae from GitHub using
#: `git`(1).
#:
-#: If `--rebase` is specified then `git pull --rebase` is used.
+#: If `--merge` is specified then `git merge` is used to include updates
+#: (rather than `git rebase`).
brew() {
"$HOMEBREW_BREW_FILE" "$@"
@@ -199,7 +200,7 @@ pull() {
# ensure we don't munge line endings on checkout
git config core.autocrlf false
- if [[ -n "$HOMEBREW_REBASE" ]]
+ if [[ -z "$HOMEBREW_MERGE" ]]
then
git rebase "${QUIET_ARGS[@]}" "origin/$UPSTREAM_BRANCH"
else
@@ -236,7 +237,7 @@ homebrew-update() {
--help) brew help update; exit $? ;;
--verbose) HOMEBREW_VERBOSE=1 ;;
--debug) HOMEBREW_DEBUG=1;;
- --rebase) HOMEBREW_REBASE=1 ;;
+ --merge) HOMEBREW_MERGE=1 ;;
--simulate-from-current-branch) HOMEBREW_SIMULATE_FROM_CURRENT_BRANCH=1 ;;
--preinstall) HOMEBREW_UPDATE_PREINSTALL=1 ;;
--*) ;;
diff --git a/share/doc/homebrew/brew.1.html b/share/doc/homebrew/brew.1.html
index 2a790aaf6d..4356cf24a4 100644
--- a/share/doc/homebrew/brew.1.html
+++ b/share/doc/homebrew/brew.1.html
@@ -390,10 +390,11 @@ source. This is useful for creating patches for the software.
unpin formulaeUnpin formulae, allowing them to be upgraded by brew upgrade. See also
pin.
untap tapRemove a tapped repository.
-update [--rebase]Fetch the newest version of Homebrew and all formulae from GitHub using
+
update [--merge]Fetch the newest version of Homebrew and all formulae from GitHub using
git(1).
-If --rebase is specified then git pull --rebase is used.
+If --merge is specified then git merge is used to include updates
+ (rather than git rebase).
upgrade [install-options] [--cleanup] [formulae]Upgrade outdated, unpinned brews.
Options for the install command are also valid here.
diff --git a/share/man/man1/brew.1 b/share/man/man1/brew.1
index a0462b58ea..5743824a3e 100644
--- a/share/man/man1/brew.1
+++ b/share/man/man1/brew.1
@@ -538,11 +538,11 @@ Unpin \fIformulae\fR, allowing them to be upgraded by \fBbrew upgrade\fR\. See a
Remove a tapped repository\.
.
.TP
-\fBupdate\fR [\fB\-\-rebase\fR]
+\fBupdate\fR [\fB\-\-merge\fR]
Fetch the newest version of Homebrew and all formulae from GitHub using \fBgit\fR(1)\.
.
.IP
-If \fB\-\-rebase\fR is specified then \fBgit pull \-\-rebase\fR is used\.
+If \fB\-\-merge\fR is specified then \fBgit merge\fR is used to include updates (rather than \fBgit rebase\fR)\.
.
.TP
\fBupgrade\fR [\fIinstall\-options\fR] [\fB\-\-cleanup\fR] [\fIformulae\fR]