From: Miklos Vajna <vmiklos@frugalware.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: [PATCH 13/13] Add new test case to ensure git-merge reduces octopus parents when possible
Date: Sat, 21 Jun 2008 19:15:35 +0200 [thread overview]
Message-ID: <1214068535-18418-1-git-send-email-vmiklos@frugalware.org> (raw)
In-Reply-To: <67668993d3fc7ea52c9c191178f3e1dea7bb4282.1214066799.git.vmiklos@frugalware.org>
The old shell version used show-branch --independent to filter for the
ones that cannot be reached from any other reference.
The new C version uses reduce_heads() from commit.c for this, so
add test to ensure it works as expected.
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---
On Sat, Jun 21, 2008 at 07:00:50PM +0200, Miklos Vajna <vmiklos@frugalware.org> wrote:
> The new C version uses filter_independent() from commit.c for this, so
> add test to ensure it works as expected.
Ouch, this info is now outdated. I updated the commit message and
renamed the test, no functional changes.
t/t7603-merge-reduce-heads.sh | 63 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 63 insertions(+), 0 deletions(-)
create mode 100755 t/t7603-merge-reduce-heads.sh
diff --git a/t/t7603-merge-reduce-heads.sh b/t/t7603-merge-reduce-heads.sh
new file mode 100755
index 0000000..17b19dc
--- /dev/null
+++ b/t/t7603-merge-reduce-heads.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+test_description='git-merge
+
+Testing octopus merge when reducing parents to independent branches.'
+
+. ./test-lib.sh
+
+# 0 - 1
+# \ 2
+# \ 3
+# \ 4 - 5
+#
+# So 1, 2, 3 and 5 should be kept, 4 should be avoided.
+
+test_expect_success 'setup' '
+ echo c0 > c0.c &&
+ git add c0.c &&
+ git commit -m c0 &&
+ git tag c0 &&
+ echo c1 > c1.c &&
+ git add c1.c &&
+ git commit -m c1 &&
+ git tag c1 &&
+ git reset --hard c0 &&
+ echo c2 > c2.c &&
+ git add c2.c &&
+ git commit -m c2 &&
+ git tag c2 &&
+ git reset --hard c0 &&
+ echo c3 > c3.c &&
+ git add c3.c &&
+ git commit -m c3 &&
+ git tag c3 &&
+ git reset --hard c0 &&
+ echo c4 > c4.c &&
+ git add c4.c &&
+ git commit -m c4 &&
+ git tag c4 &&
+ echo c5 > c5.c &&
+ git add c5.c &&
+ git commit -m c5 &&
+ git tag c5
+'
+
+test_expect_success 'merge c1 with c2, c3, c4, c5' '
+ git reset --hard c1 &&
+ git merge c2 c3 c4 c5 &&
+ test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" &&
+ test "$(git rev-parse c1)" = "$(git rev-parse HEAD^1)" &&
+ test "$(git rev-parse c2)" = "$(git rev-parse HEAD^2)" &&
+ test "$(git rev-parse c3)" = "$(git rev-parse HEAD^3)" &&
+ test "$(git rev-parse c5)" = "$(git rev-parse HEAD^4)" &&
+ git diff --exit-code &&
+ test -f c0.c &&
+ test -f c1.c &&
+ test -f c2.c &&
+ test -f c3.c &&
+ test -f c4.c &&
+ test -f c5.c
+'
+
+test_done
--
1.5.6
next prev parent reply other threads:[~2008-06-21 17:17 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-19 23:22 [PATCH 00/11] Build in merge Miklos Vajna
2008-06-19 23:22 ` [PATCH 01/11] Move split_cmdline() to alias.c Miklos Vajna
2008-06-19 23:22 ` [PATCH 02/11] Move commit_list_count() to commit.c Miklos Vajna
2008-06-19 23:22 ` [PATCH 03/11] Move parse-options's skip_prefix() to git-compat-util.h Miklos Vajna
2008-06-19 23:22 ` [PATCH 04/11] Add new test to ensure git-merge handles pull.twohead and pull.octopus Miklos Vajna
2008-06-19 23:22 ` [PATCH 05/11] parseopt: add a new PARSE_OPT_ARGV0_IS_AN_OPTION option Miklos Vajna
2008-06-19 23:22 ` [PATCH 06/11] Move read_cache_unmerged() to read-cache.c Miklos Vajna
2008-06-19 23:22 ` [PATCH 07/11] git-fmt-merge-msg: make it usable from other builtins Miklos Vajna
2008-06-19 23:22 ` [PATCH 08/11] Introduce get_octopus_merge_bases() in commit.c Miklos Vajna
2008-06-19 23:22 ` [PATCH 09/11] Introduce filter_independent() " Miklos Vajna
2008-06-19 23:22 ` [PATCH 10/11] Build in merge Miklos Vajna
2008-06-19 23:22 ` [PATCH 11/11] Add new test to ensure git-merge handles more than 25 refs Miklos Vajna
2008-06-20 3:03 ` [PATCH 09/11] Introduce filter_independent() in commit.c Junio C Hamano
2008-06-20 11:53 ` Johannes Schindelin
2008-06-20 12:06 ` Miklos Vajna
2008-06-20 12:37 ` Johannes Schindelin
2008-06-20 13:25 ` Miklos Vajna
2008-06-21 0:23 ` [PATCH] " Miklos Vajna
2008-06-21 9:45 ` Junio C Hamano
2008-06-21 17:00 ` [PATCH 00/13] Build in merge Miklos Vajna
2008-06-21 17:00 ` [PATCH 09/13] Add new test to ensure git-merge handles more than 25 refs Miklos Vajna
2008-06-21 17:00 ` [PATCH 10/13] Introduce get_merge_bases_many() Miklos Vajna
2008-06-21 17:00 ` [PATCH 11/13] Introduce reduce_heads() Miklos Vajna
2008-06-21 17:00 ` [PATCH 12/13] Build in merge Miklos Vajna
2008-06-21 17:00 ` [PATCH 13/13] Add new test case to ensure git-merge filters for independent parents Miklos Vajna
2008-06-21 17:15 ` Miklos Vajna [this message]
2008-06-25 16:22 ` [PATCH 12/13] Build in merge Olivier Marin
2008-06-27 1:06 ` Miklos Vajna
2008-06-27 11:03 ` Olivier Marin
2008-06-27 12:54 ` Miklos Vajna
2008-06-27 13:04 ` Olivier Marin
2008-06-27 13:17 ` Miklos Vajna
2008-06-27 11:56 ` Johannes Schindelin
2008-06-27 13:01 ` Miklos Vajna
2008-06-21 9:45 ` [PATCH 1/2] Introduce get_merge_bases_many() Junio C Hamano
2008-06-21 9:45 ` [PATCH 2/2] Introduce reduce_heads() Junio C Hamano
2008-06-20 3:04 ` [PATCH 00/11] Build in merge Junio C Hamano
2008-06-21 0:32 ` Miklos Vajna
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=1214068535-18418-1-git-send-email-vmiklos@frugalware.org \
--to=vmiklos@frugalware.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).