* [PATCH] t9300: use cmp instead of test_cmp to compare binary files
@ 2014-09-12 17:34 Johannes Sixt
2014-09-12 17:58 ` Junio C Hamano
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Sixt @ 2014-09-12 17:34 UTC (permalink / raw)
To: Git Mailing List
test_cmp is intended to produce diff output for human consumption. The
input in one instance in t9300-fast-import.sh are binary files, however.
Use cmp to compare the files.
This was noticed because on Windows we have a special implementation of
test_cmp in pure bash code (to ignore differences due to intermittent CR
in actual output), and bash runs into an infinite loop due to the binary
nature of the input.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
t/t9300-fast-import.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 99f5161..4b13170 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -2687,7 +2687,7 @@ test_expect_success 'R: verify created pack' '
test_expect_success \
'R: verify written objects' \
'git --git-dir=R/.git cat-file blob big-file:big1 >actual &&
- test_cmp expect actual &&
+ cmp expect actual &&
a=$(git --git-dir=R/.git rev-parse big-file:big1) &&
b=$(git --git-dir=R/.git rev-parse big-file:big2) &&
test $a = $b'
--
2.0.0.12.gbcf935e
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] t9300: use cmp instead of test_cmp to compare binary files
2014-09-12 17:34 [PATCH] t9300: use cmp instead of test_cmp to compare binary files Johannes Sixt
@ 2014-09-12 17:58 ` Junio C Hamano
2014-09-12 18:14 ` Thomas Braun
0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2014-09-12 17:58 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Git Mailing List
Johannes Sixt <j6t@kdbg.org> writes:
> test_cmp is intended to produce diff output for human consumption. The
> input in one instance in t9300-fast-import.sh are binary files, however.
> Use cmp to compare the files.
Thanks.
>
> This was noticed because on Windows we have a special implementation of
> test_cmp in pure bash code (to ignore differences due to intermittent CR
> in actual output), and bash runs into an infinite loop due to the binary
> nature of the input.
>
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> ---
> t/t9300-fast-import.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
> index 99f5161..4b13170 100755
> --- a/t/t9300-fast-import.sh
> +++ b/t/t9300-fast-import.sh
> @@ -2687,7 +2687,7 @@ test_expect_success 'R: verify created pack' '
> test_expect_success \
> 'R: verify written objects' \
> 'git --git-dir=R/.git cat-file blob big-file:big1 >actual &&
> - test_cmp expect actual &&
> + cmp expect actual &&
> a=$(git --git-dir=R/.git rev-parse big-file:big1) &&
> b=$(git --git-dir=R/.git rev-parse big-file:big2) &&
> test $a = $b'
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] t9300: use cmp instead of test_cmp to compare binary files
2014-09-12 17:58 ` Junio C Hamano
@ 2014-09-12 18:14 ` Thomas Braun
2014-09-12 19:47 ` [PATCH v2] t9300: use test_cmp_bin " Johannes Sixt
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Braun @ 2014-09-12 18:14 UTC (permalink / raw)
To: Junio C Hamano, Johannes Sixt; +Cc: Git Mailing List
Am 12.09.2014 um 19:58 schrieb Junio C Hamano:
> Johannes Sixt <j6t@kdbg.org> writes:
>
>> test_cmp is intended to produce diff output for human consumption. The
>> input in one instance in t9300-fast-import.sh are binary files, however.
>> Use cmp to compare the files.
>
> Thanks.
>
>>
>> This was noticed because on Windows we have a special implementation of
>> test_cmp in pure bash code (to ignore differences due to intermittent CR
>> in actual output), and bash runs into an infinite loop due to the binary
>> nature of the input.
>>
>> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
>> ---
>> t/t9300-fast-import.sh | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
>> index 99f5161..4b13170 100755
>> --- a/t/t9300-fast-import.sh
>> +++ b/t/t9300-fast-import.sh
>> @@ -2687,7 +2687,7 @@ test_expect_success 'R: verify created pack' '
>> test_expect_success \
>> 'R: verify written objects' \
>> 'git --git-dir=R/.git cat-file blob big-file:big1 >actual &&
>> - test_cmp expect actual &&
>> + cmp expect actual &&
>> a=$(git --git-dir=R/.git rev-parse big-file:big1) &&
>> b=$(git --git-dir=R/.git rev-parse big-file:big2) &&
>> test $a = $b'
May I suggest to use test_cmp_bin instead of plain cmp?
test_cmp_bin was introduced in
b93e6e36 (t5000, t5003: do not use test_cmp to compare binary files,
2014-06-04) and by default is plain cmp.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v2] t9300: use test_cmp_bin instead of test_cmp to compare binary files
2014-09-12 18:14 ` Thomas Braun
@ 2014-09-12 19:47 ` Johannes Sixt
0 siblings, 0 replies; 4+ messages in thread
From: Johannes Sixt @ 2014-09-12 19:47 UTC (permalink / raw)
To: Thomas Braun, Junio C Hamano; +Cc: Git Mailing List
test_cmp is intended to produce diff output for human consumption. The
input in one instance in t9300-fast-import.sh are binary files, however.
Use test_cmp_bin to compare the files.
This was noticed because on Windows we have a special implementation of
test_cmp in pure bash code (to ignore differences due to intermittent CR
in actual output), and bash runs into an infinite loop due to the binary
nature of the input.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
Am 12.09.2014 um 20:14 schrieb Thomas Braun:
> May I suggest to use test_cmp_bin instead of plain cmp?
Of course! I did remember that there was talk about it, but missed
that we actually implemented it. Sorry.
t/t9300-fast-import.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 99f5161..72845f6 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -2687,7 +2687,7 @@ test_expect_success 'R: verify created pack' '
test_expect_success \
'R: verify written objects' \
'git --git-dir=R/.git cat-file blob big-file:big1 >actual &&
- test_cmp expect actual &&
+ test_cmp_bin expect actual &&
a=$(git --git-dir=R/.git rev-parse big-file:big1) &&
b=$(git --git-dir=R/.git rev-parse big-file:big2) &&
test $a = $b'
--
2.0.0.12.gbcf935e
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-09-12 19:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-12 17:34 [PATCH] t9300: use cmp instead of test_cmp to compare binary files Johannes Sixt
2014-09-12 17:58 ` Junio C Hamano
2014-09-12 18:14 ` Thomas Braun
2014-09-12 19:47 ` [PATCH v2] t9300: use test_cmp_bin " Johannes Sixt
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).