Subject: Re: [PATCH v3] archive: initialize archivers earlier

From: Josh Steadmon <[email-masked]>
Date: Thu, 25 Oct 2018 13:29:15 -0700

On 2018.10.23 13:09, Junio C Hamano wrote:
> [email-masked] writes:
> 
> > diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
> > index 2a97b27b0a..cfd5ca492f 100755
> > --- a/t/t5000-tar-tree.sh
> > +++ b/t/t5000-tar-tree.sh
> > @@ -39,6 +39,8 @@ test_lazy_prereq TAR_NEEDS_PAX_FALLBACK '
> >  
> >  test_lazy_prereq GZIP 'gzip --version'
> >  
> > +test_lazy_prereq ZIP 'zip --version'
> > +
> 
> There are a handful of zip implementations; Info-ZIP found on many
> Linux distros does support 'zip --version', but we may want to make
> sure this test covers different implementations of zip sufficiently.
> 
> Queuing this patch (or an update of it) on 'pu' and hoping those
> with zip from different origins to try it would not help very much,
> either, as zip implementations that do not react to "zip --version"
> would silently turn the prereq off without breaking anything.
> 
> In any case, please refrain from adding any ZIP prerequiste to t5000
> which is about tar; t5003-archive-zip may be a much better fit.  It
> has an already working machinery that validates the generated zip
> archive under UNZIP prerequisite, so we may not even have to invent
> our own ZIP prereq if we did so.

Ack. This has been removed in v4. V4 also has a test case in t5003 based
on Jeff's advice.

> > @@ -206,6 +208,19 @@ test_expect_success 'git archive with --output, override inferred format' '
> >  	test_cmp_bin b.tar d4.zip
> >  '
> >  
> > +test_expect_success GZIP 'git archive with --output and --remote creates .tgz' '
> > +	git archive --output=d5.tgz --remote=. HEAD &&
> > +	gzip -d -c < d5.tgz > d5.tar &&
> > +	test_cmp_bin b.tar d5.tar
> > +'
> 
> We try to write redirections without SP between redirection operator
> and target filename, i.e. "gzip -d -c <d5.tgz >d5.tar".

Fixed in v5.