All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: Luke Diamand <luke@diamand.org>,
	git@vger.kernel.org, Romain Merland <merlorom@yahoo.fr>,
	Miguel Torroja <miguel.torroja@gmail.com>,
	Lars Schneider <larsxschneider@gmail.com>,
	George Vanburgh <gvanburgh@bloomberg.net>
Subject: Re: [PATCHv4 1/1] git-p4: add unshelve command
Date: Mon, 21 May 2018 16:07:06 +0900	[thread overview]
Message-ID: <xmqqd0xp1o85.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180520144916.5064-1-szeder.dev@gmail.com> ("SZEDER =?utf-8?Q?G=C3=A1bor=22's?= message of "Sun, 20 May 2018 16:49:16 +0200")

SZEDER Gábor <szeder.dev@gmail.com> writes:

>> diff --git a/t/t9832-unshelve.sh b/t/t9832-unshelve.sh
>> new file mode 100755
>> index 0000000000..cca2dec536

... in short, I'd queue a fix-up on top like this to be later
squashed after getting an ack?

 t/t9832-unshelve.sh | 23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/t/t9832-unshelve.sh b/t/t9832-unshelve.sh
index cca2dec536..3513abd21a 100755
--- a/t/t9832-unshelve.sh
+++ b/t/t9832-unshelve.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-last_shelved_change() {
+last_shelved_change () {
 	p4 changes -s shelved -m1 | cut -d " " -f 2
 }
 
@@ -17,7 +17,7 @@ test_expect_success 'init depot' '
 		cd "$cli" &&
 		echo file1 >file1 &&
 		p4 add file1 &&
-		p4 submit -d "change 1"
+		p4 submit -d "change 1" &&
 		: >file_to_delete &&
 		p4 add file_to_delete &&
 		p4 submit -d "file to delete"
@@ -120,29 +120,14 @@ EOF
 	)
 '
 
-diff_adds_line() {
-	text="$1" &&
-	file="$2" &&
-	grep -q "^+$text" $file || (echo "expected \"text\" $text not found in $file" && exit 1)
-}
-
-diff_excludes_line() {
-	text="$1" &&
-	file="$2" &&
-	if grep -q "^+$text" $file; then
-		echo "unexpected text \"$text\" found in $file" &&
-		exit 1
-	fi
-}
-
 # Now try to unshelve it. git-p4 should refuse to do so.
 test_expect_success 'try to unshelve the change' '
 	test_when_finished cleanup_git &&
 	(
 		change=$(last_shelved_change) &&
 		cd "$git" &&
-		! git p4 unshelve $change >out.txt 2>&1 &&
-		grep -q "cannot unshelve" out.txt
+		test_must_fail git p4 unshelve $change 2>err.txt &&
+		grep -q "cannot unshelve" err.txt
 	)
 '
 

  reply	other threads:[~2018-05-21  7:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-19 10:00 [PATCHv4 0/1] git-p4: unshelving: fix for python2.6 Luke Diamand
2018-05-19 10:00 ` [PATCHv4 1/1] git-p4: add unshelve command Luke Diamand
2018-05-20 14:49   ` SZEDER Gábor
2018-05-21  7:07     ` Junio C Hamano [this message]
2018-05-21 14:59       ` Luke Diamand
2018-05-21 21:39   ` SZEDER Gábor
2018-05-21 22:09     ` Luke Diamand
2018-05-21 22:19       ` Luke Diamand
2018-05-21 22:22       ` SZEDER Gábor

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=xmqqd0xp1o85.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gvanburgh@bloomberg.net \
    --cc=larsxschneider@gmail.com \
    --cc=luke@diamand.org \
    --cc=merlorom@yahoo.fr \
    --cc=miguel.torroja@gmail.com \
    --cc=szeder.dev@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.