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

Re: [PATCH v2] builtin/repack.c: remove redundant pack-based bitmaps

From
Jeff King <peff@peff.net>
Date
Oct 18, 2022, 06:29 UTC
Message-ID
<Y05HrVT9HxxDiXc2@coredump.intra.peff.net>
In-Reply-To
<1e0ef7ee7ff5feb323c77e594cd65433fb1d99f7.1666061096.git.me@ttaylorr.com>
On Mon, Oct 17, 2022 at 10:45:12PM -0400, Taylor Blau wrote:
Show 12 quoted lines
> When we write a MIDX bitmap after repacking, it is possible that the
> repository would be left in a state with both pack- and multi-pack
> reachability bitmaps.
> 
> This can occur, for instance, if a pack that was kept (either by having
> a .keep file, or during a geometric repack in which it is not rolled up)
> has a bitmap file, and the repack wrote a multi-pack index and bitmap.
> 
> When loading a reachability bitmap for the repository, the multi-pack
> one is always preferred, so the pack-based one is redundant. Let's
> remove it unconditionally, even if '-d' isn't passed, since there is no
> practical reason to keep both around. The patch below does just that.
Thanks, this version looks great to me.
Show 9 quoted lines
> 1:  393fd4c6db ! 1:  1e0ef7ee7f builtin/repack.c: remove redundant pack-based bitmaps
>     @@ builtin/repack.c: static int write_midx_included_packs(struct string_list *inclu
>      +		strbuf_addstr(&path, ".bitmap");
>      +
>      +		if (unlink(path.buf) && errno != ENOENT)
>     -+			die_errno(_("could not remove stale bitmap: %s"),
>     -+				  path.buf);
>     ++			warning_errno(_("could not remove stale bitmap: %s"),
>     ++				      path.buf);

As noted elsewhere in the thread, this could be unlink_or_warn(), but doing it manually lets us produce a more specific message, which is nice.

-Peff
Previous: Taylor Blau
Message 10 of 10 in “builtin/repack.c: remove redundant pack-based bitmaps”
  1. builtin/repack.c: remove redundant pack-based bitmapsTaylor Blau, Oct 12, 2022
  2. Jeff KingOct 17, 2022
  3. Ævar Arnfjörð BjarmasonOct 17, 2022
  4. Jeff KingOct 17, 2022
  5. Junio C HamanoOct 17, 2022
  6. Jeff KingOct 17, 2022
  7. Taylor BlauOct 18, 2022
  8. Taylor BlauOct 18, 2022
  9. builtin/repack.c: remove redundant pack-based bitmapsTaylor Blau, Oct 18, 2022
  10. Jeff KingOct 18, 2022

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.