# [PATCH] t9143: do not fail when unhandled.log.gz is not created

4 messages from 2010-12-04 to 2010-12-08. Participants: Torsten Bögershausen, Eric Wong.
Thread: https://gitlist.dev/t/25951

## Torsten Bögershausen, 2010-12-04 11:37

Subject: [PATCH] t9143: do not fail when unhandled.log.gz is not created
Message-ID: <4CFA27E0.8070308@web.de>
URL: https://gitlist.dev/e/4CFA27E0.8070308%40web.de

```
Commit df73af5f66 is does not let the test case fail,
when Compress::Zlib is missing.
But:
On a MacOS X 10.6 system with missing Compress::Zlib
using svn version 1.6.5 (r38866) the gz file is created.
Solution:
Check for the existance of the unhandled.log.gz file.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
---
  t/t9143-git-svn-gc.sh |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/t/t9143-git-svn-gc.sh b/t/t9143-git-svn-gc.sh
index 337ea59..8a95d78 100755
--- a/t/t9143-git-svn-gc.sh
+++ b/t/t9143-git-svn-gc.sh
@@ -37,7 +37,7 @@ test_expect_success 'git svn gc runs' 'git svn gc'
   test_expect_success 'git svn index removed' '! test -f 
.git/svn/refs/remotes/git-svn/index'
  -if perl -MCompress::Zlib -e 0 2>/dev/null
+if test -r .git/svn/refs/remotes/git-svn/unhandled.log.gz
  then
  	test_expect_success 'git svn gc produces a valid gzip file' '
  		 gunzip .git/svn/refs/remotes/git-svn/unhandled.log.gz
-- 
1.6.6

```

## Eric Wong, 2010-12-06 19:23

Subject: Re: [PATCH] t9143: do not fail when unhandled.log.gz is not created
Message-ID: <20101206192326.GA12383@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20101206192326.GA12383%40dcvr.yhbt.net
In-Reply-To: <4CFA27E0.8070308@web.de>

```
Torsten Bögershausen <tboegi@web.de> wrote:
> Commit df73af5f66 is does not let the test case fail,
> when Compress::Zlib is missing.
> But:
> On a MacOS X 10.6 system with missing Compress::Zlib
> using svn version 1.6.5 (r38866) the gz file is created.
> Solution:
> Check for the existance of the unhandled.log.gz file.

I wonder if your system could have multiple perl installations and
git-svn is calling one while the shell scripts are calling another.
I'm not sure if there is another way the gz file could be created while
Compress::Zlib is missing.

> Signed-off-by: Torsten Bögershausen <tboegi@web.de>

Torsten Bögershausen wrote in <4CFA27DD.7030105@web.de>:
> Now we do not depend on internal implementation details of svn.
> And the code is 3% easier to understand :-)

I agree on this point completely

Acked-by: Eric Wong <normalperson@yhbt.net>

> ---
>  t/t9143-git-svn-gc.sh |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/t/t9143-git-svn-gc.sh b/t/t9143-git-svn-gc.sh
> index 337ea59..8a95d78 100755
> --- a/t/t9143-git-svn-gc.sh
> +++ b/t/t9143-git-svn-gc.sh
> @@ -37,7 +37,7 @@ test_expect_success 'git svn gc runs' 'git svn gc'
>   test_expect_success 'git svn index removed' '! test -f  
> .git/svn/refs/remotes/git-svn/index'
>  -if perl -MCompress::Zlib -e 0 2>/dev/null
> +if test -r .git/svn/refs/remotes/git-svn/unhandled.log.gz
>  then
>  	test_expect_success 'git svn gc produces a valid gzip file' '
>  		 gunzip .git/svn/refs/remotes/git-svn/unhandled.log.gz
> -- 

```

## Torsten Bögershausen, 2010-12-08 16:25

Subject: Re: [PATCH] t9143: do not fail when unhandled.log.gz is not created
Message-ID: <4CFFB188.6000006@gmail.com>
URL: https://gitlist.dev/e/4CFFB188.6000006%40gmail.com
In-Reply-To: <20101206192326.GA12383@dcvr.yhbt.net>

```
On 12/06/2010 08:23 PM, Eric Wong wrote:
> Torsten Bögershausen<tboegi@web.de>  wrote:
>> Commit df73af5f66 is does not let the test case fail,
>> when Compress::Zlib is missing.
>> But:
>> On a MacOS X 10.6 system with missing Compress::Zlib
>> using svn version 1.6.5 (r38866) the gz file is created.
>> Solution:
>> Check for the existance of the unhandled.log.gz file.
>
> I wonder if your system could have multiple perl installations and
> git-svn is calling one while the shell scripts are calling another.
> I'm not sure if there is another way the gz file could be created while
> Compress::Zlib is missing.
>
>> Signed-off-by: Torsten Bögershausen<tboegi@web.de>
>
> Torsten Bögershausen wrote in<4CFA27DD.7030105@web.de>:
>> Now we do not depend on internal implementation details of svn.
>> And the code is 3% easier to understand :-)
>
> I agree on this point completely
>
> Acked-by: Eric Wong<normalperson@yhbt.net>
>
>> ---
>>   t/t9143-git-svn-gc.sh |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/t/t9143-git-svn-gc.sh b/t/t9143-git-svn-gc.sh
>> index 337ea59..8a95d78 100755
>> --- a/t/t9143-git-svn-gc.sh
>> +++ b/t/t9143-git-svn-gc.sh
>> @@ -37,7 +37,7 @@ test_expect_success 'git svn gc runs' 'git svn gc'
>>    test_expect_success 'git svn index removed' '! test -f
>> .git/svn/refs/remotes/git-svn/index'
>>   -if perl -MCompress::Zlib -e 0 2>/dev/null
>> +if test -r .git/svn/refs/remotes/git-svn/unhandled.log.gz
>>   then
>>   	test_expect_success 'git svn gc produces a valid gzip file' '
>>   		 gunzip .git/svn/refs/remotes/git-svn/unhandled.log.gz
>> --
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eric,
thanks for the input.
I have indeed 2 perl versions:
find / -xdev -name perl -type f 2>/dev/null | xargs ls -l
-rwxr-xr-x  2 root  admin  1297824 Jan  7  2010 /opt/local/bin/perl
-rwxr-xr-x  2 root  admin  1297824 Jan  7  2010 
/opt/local/var/macports/software/perl5.8/5.8.9_3/opt/local/bin/perl
-rwxr-xr-x  1 root  wheel    86000 Jun 26  2009 /usr/bin/perl
-r--r--r--  1 root  wheel     1813 May 18  2009 /usr/share/file/magic/perl

  which perl
/opt/local/bin/perl

/opt/local/bin/perl -MCompress::Zlib -e 0 ; echo $?
Can't locate Compress/Zlib.pm in @INC (@INC contains: /sw/lib/perl5 
/sw/lib/perl5/darwin /opt/local/lib/perl5/site_perl/5.8.9/darwin-2level 
/opt/local/lib/perl5/site_perl/5.8.9 /opt/local/lib/perl5/site_perl 
/opt/local/lib/perl5/vendor_perl/5.8.9/darwin-2level 
/opt/local/lib/perl5/vendor_perl/5.8.9 /opt/local/lib/perl5/vendor_perl 
/opt/local/lib/perl5/5.8.9/darwin-2level /opt/local/lib/perl5/5.8.9 .).
BEGIN failed--compilation aborted.
2


  /usr/bin/perl -MCompress::Zlib -e 0 ; echo $?
0
==================
If you agree, I will send a V2 version of the patch, which
will use the following:
---------------------------
if test -r .git/svn/refs/remotes/git-svn/unhandled.log.gz
then
	test_expect_success 'git svn gc produces a valid gzip file' '
		 gunzip .git/svn/refs/remotes/git-svn/unhandled.log.gz
		'
fi
----------------
This will simply check if the unhandled.log.gz exist,
and if, it will be unpacked.
I removed the else and
   say "# Perl Compress::Zlib unavailable, skipping gunzip test"

/Torsten

```

## Eric Wong, 2010-12-08 21:41

Subject: Re: [PATCH] t9143: do not fail when unhandled.log.gz is not created
Message-ID: <20101208214115.GA29131@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20101208214115.GA29131%40dcvr.yhbt.net
In-Reply-To: <4CFFB188.6000006@gmail.com>

```
Torsten Bögershausen <totte.enea@gmail.com> wrote:
> If you agree, I will send a V2 version of the patch, which
> will use the following:
> ---------------------------
> if test -r .git/svn/refs/remotes/git-svn/unhandled.log.gz
> then
> 	test_expect_success 'git svn gc produces a valid gzip file' '
> 		 gunzip .git/svn/refs/remotes/git-svn/unhandled.log.gz
> 		'
> fi

Yes, it's definitely a better test.  Thanks!

-- 
Eric Wong

```
