From: Thomas Rast <trast@student.ethz.ch>
To: <git@vger.kernel.org>
Cc: "Nicolas Sebrecht" <nicolas.s.dev@gmx.fr>,
Baz <brian.ewins@gmail.com>,
"Peter Krefting" <peter@softwolves.pp.se>,
"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
"Björn Steinbrink" <B.Steinbrink@gmx.de>
Subject: [PATCH 3/3] rebase: refuse to rebase with -s ours
Date: Sun, 15 Nov 2009 19:25:32 +0100 [thread overview]
Message-ID: <efd7770d166a97481e8e31e407b9c2da02a341e5.1258309432.git.trast@student.ethz.ch> (raw)
In-Reply-To: <cover.1258309432.git.trast@student.ethz.ch>
Using the "ours" strategy with rebase just discards all changes,
turning <branch> into <upstream> (or <newbase> if given). This is
unlikely to be what the user wants, so simply refuse to do it.
Also document what would happen near the -s option, and point the user
at it with the error message.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
---
Documentation/git-rebase.txt | 3 ++-
git-rebase--interactive.sh | 4 ++++
git-rebase.sh | 4 ++++
3 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 5fa9100..2203e63 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -241,7 +241,8 @@ rebased series, starting with <upstream>.
+
Due to the peculiarities of 'git-rebase' (see \--merge above), using
the 'ours' strategy simply discards all patches from the <branch>,
-which makes little sense.
+which makes little sense. Thus 'git-rebase' does not accept this
+strategy.
-q::
--quiet::
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 53ad248..c6bc156 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -584,6 +584,10 @@ first and then run 'git rebase --continue' again."
STRATEGY="-s $2"
shift ;;
esac
+ if test "$STRATEGY" = "-s ours"
+ then
+ die "Refusing to rebase with 'ours' strategy; see git help rebase."
+ fi
;;
-m)
# we use merge anyway
diff --git a/git-rebase.sh b/git-rebase.sh
index 6ec155c..2d7d566 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -306,6 +306,10 @@ do
strategy="$2"
shift ;;
esac
+ if test $strategy = ours
+ then
+ die "Refusing to rebase with 'ours' strategy; see git help rebase."
+ fi
do_merge=t
;;
-n|--no-stat)
--
1.6.5.2.420.gf6c057.dirty
next prev parent reply other threads:[~2009-11-15 18:26 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-02 12:26 git pull --rebase and losing commits Peter Krefting
2009-11-02 15:04 ` Thomas Rast
2009-11-02 21:34 ` Nanako Shiraishi
2009-11-02 15:10 ` Björn Steinbrink
2009-11-03 7:01 ` Peter Krefting
2009-11-03 9:52 ` Johannes Schindelin
2009-11-03 10:12 ` Peter Krefting
2009-11-11 14:03 ` [PATCH] Clarify documentation on the "ours" merge strategy Peter Krefting
2009-11-11 15:13 ` Baz
2009-11-11 20:35 ` Thomas Rast
2009-11-11 20:54 ` Baz
2009-11-11 21:02 ` Junio C Hamano
2009-11-11 21:30 ` [PATCH] " Nicolas Sebrecht
2009-11-11 23:37 ` Thomas Rast
2009-11-12 7:55 ` Junio C Hamano
2009-11-12 9:41 ` Peter Krefting
2009-11-14 2:12 ` Nanako Shiraishi
2009-11-15 9:10 ` Junio C Hamano
2009-11-16 8:20 ` Peter Krefting
2009-11-12 9:55 ` Björn Steinbrink
2009-11-15 18:25 ` [PATCH 0/3] Document and refuse rebase -s ours Thomas Rast
2009-11-15 18:25 ` [PATCH 1/3] Documentation: clarify 'ours' merge strategy Thomas Rast
2009-11-15 18:25 ` [PATCH 2/3] rebase docs: clarify --merge and --strategy Thomas Rast
2009-11-15 21:05 ` Junio C Hamano
2009-11-15 21:11 ` Thomas Rast
2009-11-15 18:25 ` Thomas Rast [this message]
2009-11-15 18:39 ` [PATCH 3/3] rebase: refuse to rebase with -s ours Sverre Rabbelier
2009-11-15 18:44 ` Thomas Rast
2009-11-16 12:35 ` Johannes Schindelin
2009-11-16 19:57 ` Junio C Hamano
2009-11-16 21:25 ` Johannes Schindelin
2009-11-16 21:45 ` Junio C Hamano
2009-11-16 22:04 ` Sverre Rabbelier
2009-11-16 23:04 ` A Large Angry SCM
2009-11-15 21:04 ` [PATCH 0/3] Document and refuse rebase " Junio C Hamano
2009-11-15 21:13 ` Thomas Rast
2009-11-03 10:12 ` git pull --rebase and losing commits Thomas Rast
2009-11-03 4:27 ` Randal L. Schwartz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=efd7770d166a97481e8e31e407b9c2da02a341e5.1258309432.git.trast@student.ethz.ch \
--to=trast@student.ethz.ch \
--cc=B.Steinbrink@gmx.de \
--cc=Johannes.Schindelin@gmx.de \
--cc=brian.ewins@gmail.com \
--cc=git@vger.kernel.org \
--cc=nicolas.s.dev@gmx.fr \
--cc=peter@softwolves.pp.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).