Subject: Re: [PATCH RESEND] archive: rewrite description for compression level option

From: Junio C Hamano <[email-masked]>
Date: Thu, 14 Oct 2021 23:00:14 -0700

Ævar Arnfjörð Bjarmason <[email-masked]> writes:

> Whatever we do here maybe we'd do well to emulate what "man gzip" does,
> up to and including perhaps adding the --fast and --best synonyms to
> "git archive"?

This section of the documentation is not about describing .tar.gz
but about .zip, so emulating "man gzip" to replace the description
under discussion may not be an excellent idea.  FWIW, "zip -h" on a
system where "zip" is Info-ZIP gives

	$ zip -h
	...
	-0    store only                -9 compress better
	...

and the existing "-0 or -9" that hints intermediate numbers are
possible matches its spirit.

At the implementation level, the parsing of -<number> is shared
across archivers, but ARCHIVER_HIGH_COMPRESSION_LEVELS bit is only
enabled in archive-tar, and not in archive-zip, which means that
archive-tar can take -10 and higher compression levels while
archive-zip would not, I think.  If we are to add a separate
desciption for -<number> to .tar.gz format, it would work well, as
we would not want to say it is limited to '-9' there.

As to --fast/--best, I am not sure how well it would work with
either.  Would "tar" take "tar zcf - --fast ." or "tar zc9f - ."?