{"thread":{"id":"60799","subject":"[PATCH] pack-bitmap: drop unused `reuse_objects`","startedAt":"2024-01-27T04:00:52Z","lastAt":"2024-01-29T18:14:43Z","messageCount":2,"participants":["Taylor Blau","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"487447","messageId":"0bbaf9a3591765161872fb71383263edb0c7ef83.1706328008.git.me@ttaylorr.com","threadId":"60799","inReplyTo":null,"subject":"[PATCH] pack-bitmap: drop unused `reuse_objects`","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2024-01-27T04:00:50Z","receivedAt":"2024-01-27T04:00:52Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"This variable is no longer used for doing verbatim pack-reuse (or\nanywhere within pack-bitmap.c) since d2ea031046 (pack-bitmap: don't rely\non bitmap_git->reuse_objects, 2019-12-18).\n\nRemove it to avoid an unused struct member.\n\nSigned-off-by: Taylor Blau <me@ttaylorr.com>\n---\nI noticed this while reading code in this area working on a new topic to\nstore \"pseudo-merge\" bitmaps, which can be used to accelerate bitmap\ntraversals when all commits in a given pseudo-merge appear on either\nside of a traversal.\n\n pack-bitmap.c | 7 -------\n 1 file changed, 7 deletions(-)\n\ndiff --git a/pack-bitmap.c b/pack-bitmap.c\nindex 229a11fb00..2baeabacee 100644\n--- a/pack-bitmap.c\n+++ b/pack-bitmap.c\n@@ -51,13 +51,6 @@ struct bitmap_index {\n \tstruct packed_git *pack;\n \tstruct multi_pack_index *midx;\n\n-\t/*\n-\t * Mark the first `reuse_objects` in the packfile as reused:\n-\t * they will be sent as-is without using them for repacking\n-\t * calculations\n-\t */\n-\tuint32_t reuse_objects;\n-\n \t/* mmapped buffer of the whole bitmap index */\n \tunsigned char *map;\n \tsize_t map_size; /* size of the mmaped buffer */\n--\n2.43.0.386.ge02ecfcc53.dirty\n"},{"id":"487534","messageId":"20240129181441.GB3765717@coredump.intra.peff.net","threadId":"60799","inReplyTo":"0bbaf9a3591765161872fb71383263edb0c7ef83.1706328008.git.me@ttaylorr.com","subject":"Re: [PATCH] pack-bitmap: drop unused `reuse_objects`","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2024-01-29T18:14:41Z","receivedAt":"2024-01-29T18:14:43Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jan 26, 2024 at 11:00:50PM -0500, Taylor Blau wrote:\n\n> This variable is no longer used for doing verbatim pack-reuse (or\n> anywhere within pack-bitmap.c) since d2ea031046 (pack-bitmap: don't rely\n> on bitmap_git->reuse_objects, 2019-12-18).\n> \n> Remove it to avoid an unused struct member.\n\nGood catch. This has been sitting unused for quite some time. I wonder\nif there is a way to convince the compiler to tell us about unused\nstruct fields. I guess that would imply a view of the whole linked\nprogram (though in this case the type is local to a single translation\nunit). And would probably produce a horrible number of false positives\nfor structs defined in system headers.\n\nPossibly static analyzers like coverity could help here, but it does not\nseem to find this case (or if it did, I could not find it amidst all of\nthe false positives).\n\nAnyway, your patch is obviously the right thing to do. :)\n\n-Peff\n"}]}