git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil>,
	Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>,
	Andy Parkins <andyparkins@gmail.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Johan Herland <johan@herland.net>
Subject: Re: [PATCH 2/2] Add optional parameters to the diff option "--ignore-submodules"
Date: Thu, 24 Jun 2010 19:11:43 +0200	[thread overview]
Message-ID: <4C2391CF.5090606@web.de> (raw)
In-Reply-To: <oyrgMnuxMzyEmKMa6Bb_rvLb_zp8WscXW73T03xzJ5_bpheAt9Hpcw@cipher.nrlssc.navy.mil>

Am 24.06.2010 16:23, schrieb Brandon Casey:
> On 06/08/2010 11:31 AM, Jens Lehmann wrote:
> 
> Two things...
> 
>> diff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh
>> index 83c1914..559b41e 100755
>> --- a/t/t4027-diff-submodule.sh
>> +++ b/t/t4027-diff-submodule.sh
>> @@ -103,9 +103,17 @@ test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match)'
>>  	git diff HEAD >actual &&
>>  	sed -e "1,/^@@/d" actual >actual.body &&
>>  	expect_from_to >expect.body $subprev $subprev-dirty &&
>> -	test_cmp expect.body actual.body
>> +	test_cmp expect.body actual.body &&
>> +	git diff --ignore-submodules HEAD >actual2 &&
>> +	echo -n "" | test_cmp - actual2 &&
> 
> 'echo -n' is not portable (here, and below).  Please use printf
> instead.  Ditto for t4041

Thanks, I haven't been aware of that.


>> +	git diff --ignore-submodules=untracked HEAD >actual3 &&
>> +	sed -e "1,/^@@/d" actual3 >actual3.body &&
>> +	expect_from_to >expect.body $subprev $subprev-dirty &&
>> +	test_cmp expect.body actual3.body &&
>> +	git diff --ignore-submodules=dirty HEAD >actual4 &&
>> +	echo -n "" | test_cmp - actual4
>>  '
>> -
>> +test_done
>    ^^^^^^^^^
> 
> Why is this test_done here?  There are additional tests after this point,
> and an additional call to test_done.

Grmph, this is a leftover from debugging :-(
Thank you for spotting this one too!


As the patch introducing this is already in next, here is another one:

--------------------8<--------------------------
From: Jens Lehmann <Jens.Lehmann@web.de>
Date: Thu, 24 Jun 2010 19:01:27 +0200
Subject: [PATCH] t4027 & t4041: Fix use of "echo -n" and a premature "test_done"

Replace the non portable "echo -n" with "printf" and remove a premature
"test_done".

Reported-by: Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---
 t/t4027-diff-submodule.sh        |   12 ++++++------
 t/t4041-diff-submodule-option.sh |   14 +++++++-------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh
index 559b41e..3f2e591 100755
--- a/t/t4027-diff-submodule.sh
+++ b/t/t4027-diff-submodule.sh
@@ -105,15 +105,15 @@ test_expect_success 'git diff HEAD with dirty submodule (work tree, refs match)'
 	expect_from_to >expect.body $subprev $subprev-dirty &&
 	test_cmp expect.body actual.body &&
 	git diff --ignore-submodules HEAD >actual2 &&
-	echo -n "" | test_cmp - actual2 &&
+	printf "" | test_cmp - actual2 &&
 	git diff --ignore-submodules=untracked HEAD >actual3 &&
 	sed -e "1,/^@@/d" actual3 >actual3.body &&
 	expect_from_to >expect.body $subprev $subprev-dirty &&
 	test_cmp expect.body actual3.body &&
 	git diff --ignore-submodules=dirty HEAD >actual4 &&
-	echo -n "" | test_cmp - actual4
+	printf "" | test_cmp - actual4
 '
-test_done
+
 test_expect_success 'git diff HEAD with dirty submodule (index, refs match)' '
 	(
 		cd sub &&
@@ -139,11 +139,11 @@ test_expect_success 'git diff HEAD with dirty submodule (untracked, refs match)'
 	expect_from_to >expect.body $subprev $subprev-dirty &&
 	test_cmp expect.body actual.body &&
 	git diff --ignore-submodules=all HEAD >actual2 &&
-	echo -n "" | test_cmp - actual2 &&
+	printf "" | test_cmp - actual2 &&
 	git diff --ignore-submodules=untracked HEAD >actual3 &&
-	echo -n "" | test_cmp - actual3 &&
+	printf "" | test_cmp - actual3 &&
 	git diff --ignore-submodules=dirty HEAD >actual4 &&
-	echo -n "" | test_cmp - actual4
+	printf "" | test_cmp - actual4
 '

 test_expect_success 'git diff (empty submodule dir)' '
diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh
index f44b906..7600ed1 100755
--- a/t/t4041-diff-submodule-option.sh
+++ b/t/t4041-diff-submodule-option.sh
@@ -207,17 +207,17 @@ EOF

 test_expect_success 'submodule contains untracked content (untracked ignored)' "
 	git diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&
-	echo -n '' | diff actual -
+	printf '' | diff actual -
 "

 test_expect_success 'submodule contains untracked content (dirty ignored)' "
 	git diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&
-	echo -n '' | diff actual -
+	printf '' | diff actual -
 "

 test_expect_success 'submodule contains untracked content (all ignored)' "
 	git diff-index -p --ignore-submodules=all --submodule=log HEAD >actual &&
-	echo -n '' | diff actual -
+	printf '' | diff actual -
 "

 test_expect_success 'submodule contains untracked and modifed content' "
@@ -240,13 +240,13 @@ EOF
 test_expect_success 'submodule contains untracked and modifed content (dirty ignored)' "
 	echo new > sm1/foo6 &&
 	git diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&
-	echo -n '' | diff actual -
+	printf '' | diff actual -
 "

 test_expect_success 'submodule contains untracked and modifed content (all ignored)' "
 	echo new > sm1/foo6 &&
 	git diff-index -p --ignore-submodules --submodule=log HEAD >actual &&
-	echo -n '' | diff actual -
+	printf '' | diff actual -
 "

 test_expect_success 'submodule contains modifed content' "
@@ -295,7 +295,7 @@ EOF

 test_expect_success 'modified submodule contains untracked content (all ignored)' "
 	git diff-index -p --ignore-submodules=all --submodule=log HEAD >actual &&
-	echo -n '' | diff actual -
+	printf '' | diff actual -
 "

 test_expect_success 'modified submodule contains untracked and modifed content' "
@@ -331,7 +331,7 @@ EOF
 test_expect_success 'modified submodule contains untracked and modifed content (all ignored)' "
 	echo modification >> sm1/foo6 &&
 	git diff-index -p --ignore-submodules --submodule=log HEAD >actual &&
-	echo -n '' | diff actual -
+	printf '' | diff actual -
 "

 test_expect_success 'modified submodule contains modifed content' "
-- 
1.7.1.716.g6c3d8

  reply	other threads:[~2010-06-24 17:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-08 16:30 [PATCH 0/2] Add optional parameters to the diff option "--ignore-submodules" Jens Lehmann
2010-06-08 16:31 ` [PATCH 1/2] git diff: rename test that had a conflicting name Jens Lehmann
2010-06-08 16:31 ` [PATCH 2/2] Add optional parameters to the diff option "--ignore-submodules" Jens Lehmann
2010-06-24 14:23   ` Brandon Casey
2010-06-24 17:11     ` Jens Lehmann [this message]
2010-06-08 17:28 ` [PATCH 0/2] " Junio C Hamano
2010-06-08 20:41   ` Jens Lehmann
2010-06-08 21:02     ` Johannes Schindelin
2010-06-08 23:26       ` Junio C Hamano
2010-06-08 23:36         ` Johannes Schindelin
2010-06-08 22:11 ` Johan Herland
2010-06-08 22:19   ` Jens Lehmann
2010-06-08 23:49     ` Johan Herland
2010-06-09  6:23       ` Jens Lehmann

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=4C2391CF.5090606@web.de \
    --to=jens.lehmann@web.de \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=andyparkins@gmail.com \
    --cc=brandon.casey.ctr@nrlssc.navy.mil \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johan@herland.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;
as well as URLs for NNTP newsgroup(s).