Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2020-11-09 19:05:31 +0300
committerJunio C Hamano <gitster@pobox.com>2020-11-09 22:25:45 +0300
commitcde8ea9c66e46ed6427499e0bc049d1d5c55379a (patch)
treedae3bf84c984e5a646594a154dbcf57d8aa2cbc7 /archive.h
parent898f80736c75878acc02dc55672317fcc0e0a5a6 (diff)
archive: support compression levels beyond 9
Compression programs like zip, gzip, bzip2 and xz allow to adjust the trade-off between CPU cost and size gain with numerical options from -1 for fast compression and -9 for high compression ratio. zip also accepts -0 for storing files verbatim. git archive directly support these single-digit compression levels for ZIP output and passes them to filters like gzip. Zstandard additionally supports compression level options -10 to -19, or up to -22 with --ultra. This *seems* to work with git archive in most cases, e.g. it will produce an archive with -19 without complaining, but since it only supports single-digit compression level options this is the same as -1 -9 and thus -9. Allow git archive to accept multi-digit compression levels to support the full range supported by zstd. Explicitly reject them for the ZIP format, as otherwise deflateInit2() would just fail with a somewhat cryptic "stream consistency error". Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'archive.h')
-rw-r--r--archive.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/archive.h b/archive.h
index 82b226011a..e3d04e8ab3 100644
--- a/archive.h
+++ b/archive.h
@@ -36,6 +36,7 @@ const char *archive_format_from_filename(const char *filename);
#define ARCHIVER_WANT_COMPRESSION_LEVELS 1
#define ARCHIVER_REMOTE 2
+#define ARCHIVER_HIGH_COMPRESSION_LEVELS 4
struct archiver {
const char *name;
int (*write_archive)(const struct archiver *, struct archiver_args *);