Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Eric Wong <normalperson@yhbt.net>
Cc: git@vger.kernel.org
Subject: [PATCH] Add renaming-rebase test.
Date: Sun, 18 Jun 2006 04:48:26 -0700	[thread overview]
Message-ID: <7vslm21y7p.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 1150599735483-git-send-email-normalperson@yhbt.net

This tests Eric's "renaming rebase" patch.  It tests only very
basic cases and most of the tests except the last one passes.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 t/t3402-rebase-merge.sh |   96 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 96 insertions(+), 0 deletions(-)

diff --git a/t/t3402-rebase-merge.sh b/t/t3402-rebase-merge.sh
new file mode 100755
index 0000000..8c7a519
--- /dev/null
+++ b/t/t3402-rebase-merge.sh
@@ -0,0 +1,96 @@
+#!/bin/sh
+#
+# Copyright (c) 2006 Junio C Hamano
+#
+
+test_description='git rebase --merge test'
+
+. ./test-lib.sh
+
+T="A quick brown fox
+jumps over the lazy dog."
+for i in 1 2 3 4 5 6 7 8 9 10
+do
+	echo "$i $T"
+done >original
+
+test_expect_success setup '
+	git add original &&
+	git commit -m"initial" &&
+	git branch side &&
+	echo "11 $T" >>original &&
+	git commit -a -m"master updates a bit." &&
+
+	echo "12 $T" >>original &&
+	git commit -a -m"master updates a bit more." &&
+
+	git checkout side &&
+	(echo "0 $T" ; cat original) >renamed &&
+	git add renamed &&
+	git update-index --force-remove original &&
+	git commit -a -m"side renames and edits." &&
+
+	tr "[a-z]" "[A-Z]" <original >newfile &&
+	git add newfile &&
+	git commit -a -m"side edits further." &&
+
+	tr "[a-m]" "[A-M]" <original >newfile &&
+	rm -f original &&
+	git commit -a -m"side edits once again." &&
+
+	git branch test-rebase side &&
+	git branch test-rebase-pick side &&
+	git branch test-reference-pick side &&
+	git checkout -b test-merge side
+'
+
+test_expect_success 'reference merge' '
+	git merge -s recursive "reference merge" HEAD master
+'
+
+test_expect_success rebase '
+	git checkout test-rebase &&
+	git rebase --merge master
+'
+
+test_expect_success 'merge and rebase should match' '
+	git diff-tree -r test-rebase test-merge >difference &&
+	if test -s difference
+	then
+		cat difference
+		(exit 1)
+	else
+		echo happy
+	fi
+'
+
+test_expect_success 'rebase the other way' '
+	git reset --hard master &&
+	git rebase --merge side
+'
+
+test_expect_success 'merge and rebase should match' '
+	git diff-tree -r test-rebase test-merge >difference &&
+	if test -s difference
+	then
+		cat difference
+		(exit 1)
+	else
+		echo happy
+	fi
+'
+
+test_expect_success 'picking rebase' '
+	git reset --hard side &&
+	git rebase --merge --onto master side^^ &&
+	mb=$(git merge-base master HEAD) &&
+	if test "$mb" = "$(git rev-parse master)"
+	then
+		echo happy
+	else
+		git show-branch
+		(exit 1)
+	fi
+'
+
+test_done
-- 
1.4.0.g1910f

      parent reply	other threads:[~2006-06-18 11:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-18  3:02 [PATCH] rebase: Allow merge strategies to be used when rebasing Eric Wong
2006-06-18  9:08 ` Junio C Hamano
2006-06-19 21:39   ` Eric Wong
2006-06-19 21:55     ` Junio C Hamano
2006-06-21 10:01       ` Eric Wong
2006-06-21 10:04         ` [PATCH (fixed)] " Eric Wong
2006-06-21 10:04           ` [PATCH 1/3] " Eric Wong
2006-06-21 10:04             ` [PATCH 3/3] rebase: error out for NO_PYTHON if they use recursive merge Eric Wong
2006-06-21 11:01           ` [PATCH (fixed)] rebase: Allow merge strategies to be used when rebasing Junio C Hamano
2006-06-21 11:01         ` [PATCH] " Junio C Hamano
2006-06-18 11:48 ` Junio C Hamano [this message]

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=7vslm21y7p.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=normalperson@yhbt.net \
    /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