git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] pack-bitmap: drop unused `reuse_objects`

From
Jeff King <peff@peff.net>
Date
Jan 29, 2024, 18:14 UTC
Message-ID
<20240129181441.GB3765717@coredump.intra.peff.net>
In-Reply-To
<0bbaf9a3591765161872fb71383263edb0c7ef83.1706328008.git.me@ttaylorr.com>
On Fri, Jan 26, 2024 at 11:00:50PM -0500, Taylor Blau wrote:
Show 5 quoted lines
> This variable is no longer used for doing verbatim pack-reuse (or
> anywhere within pack-bitmap.c) since d2ea031046 (pack-bitmap: don't rely
> on bitmap_git->reuse_objects, 2019-12-18).
> 
> Remove it to avoid an unused struct member.

Good catch. This has been sitting unused for quite some time. I wonder if there is a way to convince the compiler to tell us about unused struct fields. I guess that would imply a view of the whole linked program (though in this case the type is local to a single translation unit). And would probably produce a horrible number of false positives for structs defined in system headers.

Possibly static analyzers like coverity could help here, but it does not seem to find this case (or if it did, I could not find it amidst all of the false positives).

Anyway, your patch is obviously the right thing to do. :)
-Peff
Previous: Taylor Blau
Message 2 of 2 in “pack-bitmap: drop unused `reuse_objects`”
  1. pack-bitmap: drop unused `reuse_objects`Taylor Blau, Jan 27, 2024
  2. Jeff KingJan 29, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.