git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Richard Hansen <hansenr@google.com>
To: git@vger.kernel.org
Cc: davvid@gmail.com, j6t@kdbg.org, hansenr@google.com,
	sbeller@google.com, simon@ruderich.org
Subject: [PATCH v3 03/13] t7610: Move setup code to the 'setup' test case.
Date: Mon,  9 Jan 2017 00:42:28 -0500	[thread overview]
Message-ID: <20170109054238.42599-4-hansenr@google.com> (raw)
In-Reply-To: <20170109054238.42599-1-hansenr@google.com>

[-- Attachment #1: Type: text/plain, Size: 3682 bytes --]

Multiple test cases depend on these hunks, so move them to the 'setup'
test case.  This is a step toward making the tests more independent so
that if one test fails it doesn't cause subsequent tests to fail.

Signed-off-by: Richard Hansen <hansenr@google.com>
---
 t/t7610-mergetool.sh | 65 ++++++++++++++++++++++++++++------------------------
 1 file changed, 35 insertions(+), 30 deletions(-)

diff --git a/t/t7610-mergetool.sh b/t/t7610-mergetool.sh
index 14090739f..550838a1c 100755
--- a/t/t7610-mergetool.sh
+++ b/t/t7610-mergetool.sh
@@ -55,6 +55,22 @@ test_expect_success 'setup' '
 	git rm file12 &&
 	git commit -m "branch1 changes" &&
 
+	git checkout -b delete-base branch1 &&
+	mkdir -p a/a &&
+	(echo one; echo two; echo 3; echo 4) >a/a/file.txt &&
+	git add a/a/file.txt &&
+	git commit -m"base file" &&
+	git checkout -b move-to-b delete-base &&
+	mkdir -p b/b &&
+	git mv a/a/file.txt b/b/file.txt &&
+	(echo one; echo two; echo 4) >b/b/file.txt &&
+	git commit -a -m"move to b" &&
+	git checkout -b move-to-c delete-base &&
+	mkdir -p c/c &&
+	git mv a/a/file.txt c/c/file.txt &&
+	(echo one; echo two; echo 3) >c/c/file.txt &&
+	git commit -a -m"move to c" &&
+
 	git checkout -b stash1 master &&
 	echo stash1 change file11 >file11 &&
 	git add file11 &&
@@ -86,6 +102,23 @@ test_expect_success 'setup' '
 	git rm file11 &&
 	git commit -m "master updates" &&
 
+	git clean -fdx &&
+	git checkout -b order-file-start master &&
+	echo start >a &&
+	echo start >b &&
+	git add a b &&
+	git commit -m start &&
+	git checkout -b order-file-side1 order-file-start &&
+	echo side1 >a &&
+	echo side1 >b &&
+	git add a b &&
+	git commit -m side1 &&
+	git checkout -b order-file-side2 order-file-start &&
+	echo side2 >a &&
+	echo side2 >b &&
+	git add a b &&
+	git commit -m side2 &&
+
 	git config merge.tool mytool &&
 	git config mergetool.mytool.cmd "cat \"\$REMOTE\" >\"\$MERGED\"" &&
 	git config mergetool.mytool.trustExitCode true &&
@@ -244,21 +277,7 @@ test_expect_success 'mergetool takes partial path' '
 '
 
 test_expect_success 'mergetool delete/delete conflict' '
-	git checkout -b delete-base branch1 &&
-	mkdir -p a/a &&
-	(echo one; echo two; echo 3; echo 4) >a/a/file.txt &&
-	git add a/a/file.txt &&
-	git commit -m"base file" &&
-	git checkout -b move-to-b delete-base &&
-	mkdir -p b/b &&
-	git mv a/a/file.txt b/b/file.txt &&
-	(echo one; echo two; echo 4) >b/b/file.txt &&
-	git commit -a -m"move to b" &&
-	git checkout -b move-to-c delete-base &&
-	mkdir -p c/c &&
-	git mv a/a/file.txt c/c/file.txt &&
-	(echo one; echo two; echo 3) >c/c/file.txt &&
-	git commit -a -m"move to c" &&
+	git checkout move-to-c &&
 	test_must_fail git merge move-to-b &&
 	echo d | git mergetool a/a/file.txt &&
 	! test -f a/a/file.txt &&
@@ -607,26 +626,12 @@ test_expect_success MKTEMP 'temporary filenames are used with mergetool.writeToT
 '
 
 test_expect_success 'diff.orderFile configuration is honored' '
+	git checkout order-file-side2 &&
 	test_config diff.orderFile order-file &&
 	test_config mergetool.myecho.cmd "echo \"\$LOCAL\"" &&
 	test_config mergetool.myecho.trustExitCode true &&
 	echo b >order-file &&
 	echo a >>order-file &&
-	git checkout -b order-file-start master &&
-	echo start >a &&
-	echo start >b &&
-	git add a b &&
-	git commit -m start &&
-	git checkout -b order-file-side1 order-file-start &&
-	echo side1 >a &&
-	echo side1 >b &&
-	git add a b &&
-	git commit -m side1 &&
-	git checkout -b order-file-side2 order-file-start &&
-	echo side2 >a &&
-	echo side2 >b &&
-	git add a b &&
-	git commit -m side2 &&
 	test_must_fail git merge order-file-side1 &&
 	cat >expect <<-\EOF &&
 		Merging:
-- 
2.11.0.390.gc69c2f50cf-goog


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4845 bytes --]

  parent reply	other threads:[~2017-01-09  5:43 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04  0:50 [PATCH 0/4] fix mergetool+rerere+subdir regression Richard Hansen
2017-01-04  0:50 ` [PATCH 1/4] t7610: update branch names to match test number Richard Hansen
2017-01-04  0:50 ` [PATCH 2/4] t7610: make tests more independent and debuggable Richard Hansen
2017-01-04 20:27   ` Stefan Beller
2017-01-05 15:41     ` Richard Hansen
2017-01-05 15:46     ` Richard Hansen
2017-01-05 12:20   ` Simon Ruderich
2017-01-05 15:48     ` Richard Hansen
2017-01-04  0:50 ` [PATCH 3/4] t7610: add test case for rerere+mergetool+subdir bug Richard Hansen
2017-01-04  0:50 ` [PATCH 4/4] mergetool: fix running in subdir when rerere enabled Richard Hansen
2017-01-06  1:09 ` [PATCH v2 0/4] fix mergetool+rerere+subdir regression Richard Hansen
2017-01-06  1:09   ` [PATCH v2 1/4] t7610: update branch names to match test number Richard Hansen
2017-01-06  1:09   ` [PATCH v2 2/4] t7610: make tests more independent and debuggable Richard Hansen
2017-01-06  1:31     ` Stefan Beller
2017-01-07  1:53       ` Richard Hansen
2017-01-06  1:09   ` [PATCH v2 3/4] t7610: add test case for rerere+mergetool+subdir bug Richard Hansen
2017-01-06  1:09   ` [PATCH v2 4/4] mergetool: fix running in subdir when rerere enabled Richard Hansen
2017-01-06  9:42     ` Johannes Sixt
2017-01-07  2:16       ` Richard Hansen
2017-01-09  5:42   ` [PATCH v3 00/13] fix mergetool+rerere+subdir regression Richard Hansen
2017-01-09  5:42     ` [PATCH v3 01/13] .mailmap: Use my personal email address as my canonical Richard Hansen
2017-01-09  5:42     ` [PATCH v3 02/13] t7610: update branch names to match test number Richard Hansen
2017-01-09  5:42     ` Richard Hansen [this message]
2017-01-09  5:42     ` [PATCH v3 04/13] t7610: use test_when_finished for cleanup tasks Richard Hansen
2017-01-09  5:42     ` [PATCH v3 05/13] t7610: don't rely on state from previous test Richard Hansen
2017-01-09  5:42     ` [PATCH v3 06/13] t7610: run 'git reset --hard' after each test to clean up Richard Hansen
2017-01-09  5:42     ` [PATCH v3 07/13] t7610: delete some now-unnecessary 'git reset --hard' lines Richard Hansen
2017-01-09  5:42     ` [PATCH v3 08/13] t7610: always work on a test-specific branch Richard Hansen
2017-01-09  5:42     ` [PATCH v3 09/13] t7610: don't assume the checked-out commit Richard Hansen
2017-01-09  5:42     ` [PATCH v3 10/13] t7610: spell 'git reset --hard' consistently Richard Hansen
2017-01-09  5:42     ` [PATCH v3 11/13] t7610: add test case for rerere+mergetool+subdir bug Richard Hansen
2017-01-09  5:42     ` [PATCH v3 12/13] mergetool: take the "-O" out of $orderfile Richard Hansen
2017-01-09  5:42     ` [PATCH v3 13/13] mergetool: fix running in subdir when rerere enabled Richard Hansen
2017-01-09 18:12       ` Junio C Hamano
2017-01-09 19:05         ` Junio C Hamano
2017-01-09 19:53           ` Johannes Sixt
2017-01-09 22:57           ` Richard Hansen
2017-01-09 23:29           ` Junio C Hamano
2017-01-09 23:32             ` Junio C Hamano
2017-01-09 23:50             ` Richard Hansen
2017-01-09 18:49     ` [PATCH v3 00/13] fix mergetool+rerere+subdir regression Stefan Beller
2017-01-09 23:29     ` [PATCH v4 00/14] " Richard Hansen
2017-01-09 23:29       ` [PATCH v4 01/14] .mailmap: Use my personal email address as my canonical Richard Hansen
2017-01-09 23:29       ` [PATCH v4 02/14] rev-parse doc: use "--" in the --prefix example Richard Hansen
2017-01-09 23:29       ` [PATCH v4 03/14] t7610: update branch names to match test number Richard Hansen
2017-01-09 23:29       ` [PATCH v4 04/14] t7610: Move setup code to the 'setup' test case Richard Hansen
2017-01-09 23:29       ` [PATCH v4 05/14] t7610: use test_when_finished for cleanup tasks Richard Hansen
2017-01-09 23:29       ` [PATCH v4 06/14] t7610: don't rely on state from previous test Richard Hansen
2017-01-09 23:29       ` [PATCH v4 07/14] t7610: run 'git reset --hard' after each test to clean up Richard Hansen
2017-01-09 23:29       ` [PATCH v4 08/14] t7610: delete some now-unnecessary 'git reset --hard' lines Richard Hansen
2017-01-09 23:29       ` [PATCH v4 09/14] t7610: always work on a test-specific branch Richard Hansen
2017-01-09 23:29       ` [PATCH v4 10/14] t7610: don't assume the checked-out commit Richard Hansen
2017-01-09 23:29       ` [PATCH v4 11/14] t7610: spell 'git reset --hard' consistently Richard Hansen
2017-01-09 23:29       ` [PATCH v4 12/14] t7610: add test case for rerere+mergetool+subdir bug Richard Hansen
2017-01-09 23:29       ` [PATCH v4 13/14] mergetool: take the "-O" out of $orderfile Richard Hansen
2017-01-09 23:29       ` [PATCH v4 14/14] mergetool: fix running in subdir when rerere enabled Richard Hansen
2017-01-10  6:17         ` Johannes Sixt
2017-01-10 17:09           ` Richard Hansen
2017-01-10 19:25           ` Junio C Hamano
2017-01-10 20:29             ` Johannes Sixt
2017-01-10 20:41       ` [PATCH v5 00/14] fix mergetool+rerere+subdir regression Richard Hansen
2017-01-10 20:41         ` [PATCH v5 01/14] .mailmap: Use my personal email address as my canonical Richard Hansen
2017-01-10 20:41         ` [PATCH v5 02/14] rev-parse doc: pass "--" to rev-parse in the --prefix example Richard Hansen
2017-01-10 20:41         ` [PATCH v5 03/14] t7610: update branch names to match test number Richard Hansen
2017-01-10 20:41         ` [PATCH v5 04/14] t7610: Move setup code to the 'setup' test case Richard Hansen
2017-01-10 20:41         ` [PATCH v5 05/14] t7610: use test_when_finished for cleanup tasks Richard Hansen
2017-01-10 20:41         ` [PATCH v5 06/14] t7610: don't rely on state from previous test Richard Hansen
2017-01-10 20:41         ` [PATCH v5 07/14] t7610: run 'git reset --hard' after each test to clean up Richard Hansen
2017-01-10 20:41         ` [PATCH v5 08/14] t7610: delete some now-unnecessary 'git reset --hard' lines Richard Hansen
2017-01-10 20:41         ` [PATCH v5 09/14] t7610: always work on a test-specific branch Richard Hansen
2017-01-10 20:41         ` [PATCH v5 10/14] t7610: don't assume the checked-out commit Richard Hansen
2017-01-10 20:41         ` [PATCH v5 11/14] t7610: spell 'git reset --hard' consistently Richard Hansen
2017-01-10 20:42         ` [PATCH v5 12/14] t7610: add test case for rerere+mergetool+subdir bug Richard Hansen
2017-01-10 20:42         ` [PATCH v5 13/14] mergetool: take the "-O" out of $orderfile Richard Hansen
2017-01-10 20:42         ` [PATCH v5 14/14] mergetool: fix running in subdir when rerere enabled Richard Hansen
2017-01-10  4:36 ` [PATCH 0/4] fix mergetool+rerere+subdir regression David Aguilar

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170109054238.42599-4-hansenr@google.com \
    --to=hansenr@google.com \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=sbeller@google.com \
    --cc=simon@ruderich.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).