git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] Prepare for non-interactive merge-preserving rebase
@ 2008-09-23 20:57 Andreas Ericsson
  2008-09-23 21:22 ` Stephen Haberman
  2008-10-01 20:27 ` [PATCH] Add branch.autosetuppreservemerges and branch.<name>.preservemerges Stephen Haberman
  0 siblings, 2 replies; 13+ messages in thread
From: Andreas Ericsson @ 2008-09-23 20:57 UTC (permalink / raw)
  To: Git Mailing List, Junio C Hamano, Stephen Haberman

This patch adds two tests (really three, but one of
them just handles setup) which we currently expect
to fail.

One of them tests "git rebase -p", without the -i flag,
to make sure it works without phony editors and suchlike.

The other tests "git pull --rebase --preserve-merges"
to make sure that the same functionality exists there.

The test was originally written by Stephen Habermann
<stephen@exigencecorp.com> but has been significantly
modified since its creation.

Signed-off-by: Andreas Ericsson <ae@op5.se>
---

Stephen, I had to modify the tests a bit to get them to work with
how I implemented the merge-preserving rebase, and also to remove
a lot of the cruft that was previously in there. Hope you're ok
with the attribution in the commit message.

 t/t3409-rebase-preserve-merges.sh |   68 +++++++++++++++++++++++++++++++++++++
 1 files changed, 68 insertions(+), 0 deletions(-)
 create mode 100644 t/t3409-rebase-preserve-merges.sh

diff --git a/t/t3409-rebase-preserve-merges.sh b/t/t3409-rebase-preserve-merges.sh
new file mode 100644
index 0000000..532b220
--- /dev/null
+++ b/t/t3409-rebase-preserve-merges.sh
@@ -0,0 +1,68 @@
+#!/bin/sh
+#
+# Copyright(C) 2008 Stephen Habermann & Andreas Ericsson
+#
+test_description='git rebase -p should preserve merges
+
+This test runs various incantations of "git rebase -p" and checks
+that merges are properly carried along
+'
+. ./test-lib.sh
+
+GIT_AUTHOR_EMAIL=bogus_email_address
+export GIT_AUTHOR_EMAIL
+
+#echo 'Setting up:
+#
+#A1--A2  <-- origin/master
+# \   \
+#  B1--M  <-- topic
+#   \
+#    B2  <-- origin/topic
+#
+#'
+
+test_expect_success 'setup for merge-preserving rebase' \
+	'echo First > A &&
+	git add A &&
+	git-commit -m "Add A1" &&
+	git checkout -b topic &&
+	echo Second > B &&
+	git add B &&
+	git-commit -m "Add B1" &&
+	git checkout -f master &&
+	echo Third >> A &&
+	git-commit -a -m "Modify A2" &&
+
+	git clone ./. clone1 &&
+	cd clone1 &&
+	git checkout -b topic origin/topic &&
+	git merge origin/master &&
+	cd ..
+
+	git clone ./. clone2
+	cd clone2 &&
+	git checkout -b topic origin/topic &&
+	git merge origin/master &&
+	cd .. &&
+
+	git checkout topic &&
+	echo Fourth >> B &&
+	git commit -a -m "Modify B2"
+'
+
+test_expect_failure 'git pull --rebase -p on moved topic' '
+	cd clone1 &&
+	git pull --rebase --preserve-merges &&
+	test $(git rev-list --all --pretty=oneline | grep "Modify A" | wc -l) = 1
+'
+
+test_expect_failure 'rebase -p merge on moved topic' '
+	cd ../clone2 &&
+	git fetch &&
+	git rebase -p origin/topic &&
+	test 1 = $(git rev-list --all --pretty=oneline | grep "Modify A" | wc -l) &&
+	test 1 = $(git rev-list --all --pretty=oneline | grep "Merge commit" | wc -l)
+'
+
+test_done
-- 
1.6.0.2.307.gc4275.dirty

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-10-15  8:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-23 20:57 [PATCH 1/3] Prepare for non-interactive merge-preserving rebase Andreas Ericsson
2008-09-23 21:22 ` Stephen Haberman
2008-09-23 21:30   ` Andreas Ericsson
2008-09-24  0:10     ` SZEDER Gábor
2008-09-24  6:17       ` Johannes Sixt
2008-09-24  7:13       ` Andreas Ericsson
2008-10-15  8:07       ` Stephen Haberman
2008-09-27 17:55   ` Andreas Ericsson
2008-09-27 19:20     ` Stephen Haberman
2008-09-29 16:01     ` Shawn O. Pearce
2008-09-29 16:04       ` Andreas Ericsson
2008-09-29 16:11         ` Shawn O. Pearce
2008-10-01 20:27 ` [PATCH] Add branch.autosetuppreservemerges and branch.<name>.preservemerges Stephen Haberman

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).