{"thread":{"id":"56485","subject":"[PATCH] compression: drop write-only core_compression_* variables","startedAt":"2021-09-11T11:45:50Z","lastAt":"2021-09-11T14:15:47Z","messageCount":2,"participants":["René Scharfe","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"435549","messageId":"6ed7da24-81d0-0b5e-dca3-664d2c773474@web.de","threadId":"56485","inReplyTo":null,"subject":"[PATCH] compression: drop write-only core_compression_* variables","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2021-09-11T11:45:43Z","receivedAt":"2021-09-11T11:45:50Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Since 8de7eeb54b (compression: unify pack.compression configuration\nparsing, 2016-11-15) the variables core_compression_level and\ncore_compression_seen are only set, but never read.  Remove them.\n\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\n cache.h       | 1 -\n config.c      | 3 ---\n environment.c | 1 -\n 3 files changed, 5 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex d23de69368..933bd33e69 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -958,7 +958,6 @@ extern char *apply_default_ignorewhitespace;\n extern const char *git_attributes_file;\n extern const char *git_hooks_path;\n extern int zlib_compression_level;\n-extern int core_compression_level;\n extern int pack_compression_level;\n extern size_t packed_git_window_size;\n extern size_t packed_git_limit;\ndiff --git a/config.c b/config.c\nindex cb4a8058bf..7eca6aff8b 100644\n--- a/config.c\n+++ b/config.c\n@@ -76,7 +76,6 @@ static struct key_value_info *current_config_kvi;\n  */\n static enum config_scope current_parsing_scope;\n\n-static int core_compression_seen;\n static int pack_compression_seen;\n static int zlib_compression_seen;\n\n@@ -1400,8 +1399,6 @@ static int git_default_core_config(const char *var, const char *value, void *cb)\n \t\t\tlevel = Z_DEFAULT_COMPRESSION;\n \t\telse if (level < 0 || level > Z_BEST_COMPRESSION)\n \t\t\tdie(_(\"bad zlib compression level %d\"), level);\n-\t\tcore_compression_level = level;\n-\t\tcore_compression_seen = 1;\n \t\tif (!zlib_compression_seen)\n \t\t\tzlib_compression_level = level;\n \t\tif (!pack_compression_seen)\ndiff --git a/environment.c b/environment.c\nindex d6b22ede7e..b4ba4fa22d 100644\n--- a/environment.c\n+++ b/environment.c\n@@ -41,7 +41,6 @@ char *apply_default_ignorewhitespace;\n const char *git_attributes_file;\n const char *git_hooks_path;\n int zlib_compression_level = Z_BEST_SPEED;\n-int core_compression_level;\n int pack_compression_level = Z_DEFAULT_COMPRESSION;\n int fsync_object_files;\n size_t packed_git_window_size = DEFAULT_PACKED_GIT_WINDOW_SIZE;\n--\n2.33.0\n"},{"id":"435550","messageId":"YTy6ELXWB2DdDLYN@coredump.intra.peff.net","threadId":"56485","inReplyTo":"6ed7da24-81d0-0b5e-dca3-664d2c773474@web.de","subject":"Re: [PATCH] compression: drop write-only core_compression_* variables","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-09-11T14:15:44Z","receivedAt":"2021-09-11T14:15:47Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Sep 11, 2021 at 01:45:43PM +0200, René Scharfe wrote:\n\n> Since 8de7eeb54b (compression: unify pack.compression configuration\n> parsing, 2016-11-15) the variables core_compression_level and\n> core_compression_seen are only set, but never read.  Remove them.\n\nThis makes sense, but it seemed weirdly familiar.\n\nIt looks like something similar was part of this series:\n\n  https://lore.kernel.org/git/20210731024221.2113906-1-mathstuf@gmail.com/\n\nwhich seems to have slipped through the cracks (and has several other\ncleanups). Maybe we can resurrect it (though I think your cleanup of the\nrelated \"seen\" variable here means we should take this in the meantime).\n\n-Peff\n"}]}