Re: [PATCH 7/7] archive: provide builtin .tar.gz filter
- From
Jeff King <peff@github.com>
- Date
- Jun 16, 2011, 00:38 UTC
- Message-ID
- <20110616003800.GC20355@sigill.intra.peff.net>
- In-Reply-To
- <7v7h8mir5u.fsf@alter.siamese.dyndns.org>
On Wed, Jun 15, 2011 at 04:55:57PM -0700, Junio C Hamano wrote:
Show 7 quoted lines
> > +test_expect_success 'infer tgz from .tgz filename' ' > > + git archive --output=j1.tgz HEAD && > > + test_cmp j.tgz j1.tgz > > +' > > I suspect this would get intermittent failures for the same reason as > 0c8c385 (gitweb: supply '-n' to gzip for identical output, 2011-04-26)
Ick, yeah. I pulled these tests from my original internal implementation, which I suspect may have been more stable.
The filename will always be stdin, which is OK, but the timestamp will probably get us.
Show 13 quoted lines
> diff --git a/archive-tar-filter.c b/archive-tar-filter.c
> index de8719a..d6e4e32 100644
> --- a/archive-tar-filter.c
> +++ b/archive-tar-filter.c
> @@ -131,7 +131,7 @@ static void load_builtin_filters(void)
> struct tar_filter *tf;
>
> tf = tar_filter_new("tgz", strlen("tgz"));
> - tf->command = xstrdup("gzip");
> + tf->command = xstrdup("gzip -n");
> string_list_append(&tf->extensions, "tgz");
> string_list_append(&tf->extensions, "tar.gz");
> tf->use_compression = 1;This feels a little wrong, as we are changing what the tool outputs all the time just to appease a poorly-written test. Maybe nobody cares about the timestamp field (I certainly don't), but it seems like it might surprise some users.
-Peff