Re: [PATCH] t5000, t5003: do not use test_cmp to compare binary files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 04.06.2014 13:42, schrieb Stepan Kasal:
> test_cmp() is primarily meant to compare text files (and display the
> difference for debug purposes).
> 
> Raw "cmp" is better suited to compare binary files (tar, zip, etc.).
> 
> On MinGW, test_cmp is a shell function mingw_test_cmp that tries to
> read both files into environment, stripping CR characters (introduced
> in commit 4d715ac0).
> 
> This function usually speeds things up, as fork is extremly slow on
> Windows.  But no wonder that this function is extremely slow and
> sometimes even crashes when comparing large tar or zip files.
> 
> Signed-off-by: Stepan Kasal <kasal@xxxxxx>
> ---
>  t/t5000-tar-tree.sh             | 34 +++++++++++++++++-----------------
>  t/t5001-archive-attr.sh         |  2 +-
>  t/t5003-archive-zip.sh          |  6 +++---
>  t/t5004-archive-corner-cases.sh |  2 +-
>  4 files changed, 22 insertions(+), 22 deletions(-)
> 
> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
> index 1cf0a4e..31b1fd1 100755
> --- a/t/t5000-tar-tree.sh
> +++ b/t/t5000-tar-tree.sh
> @@ -164,7 +164,7 @@ check_tar with_olde-prefix olde-
>  test_expect_success 'git archive on large files' '
>      test_config core.bigfilethreshold 1 &&
>      git archive HEAD >b3.tar &&
> -    test_cmp b.tar b3.tar
> +    cmp b.tar b3.tar
>  '

Wouldn't a function like test_cmp_bin() be better suited for all?
The windows folks can then use cmp inside test_cmp_bin() and all others
just use test_cmp.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]