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

Re: [PATCH] pack-objects: disable pack reuse for object-selection options

From
Junio C Hamano <gitster@pobox.com>
Date
May 8, 2017, 04:56 UTC
Message-ID
<xmqq4lww9cas.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20170502084326.65eisqmr4th5cbf7@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 7 quoted lines
> If certain options like --honor-pack-keep, --local, or
> --incremental are used with pack-objects, then we need to
> feed each potential object to want_object_in_pack() to see
> if it should be filtered out.  This is totally contrary to
> the purpose of the pack-reuse optimization, which tries hard
> to avoid doing any per-object work.  Therefore we need to
> disable this optimization when these options are in use.

I read this five times, as I wanted to understand what you are saying, but I am not sure if I got it right. One of the reasons why I was confused was that I originally thought this "reuse" was about delta reuse, but it is not. It is "sending a slice of the original packfile straight to the output". But even after getting myself out of that confusion, I still do not see why we "need to disable". Surely, even if we need to exclude some objects from an existing packfile due to these selection options, we should be able to reuse the non-excluded part, no? The end result may involve having to pick and reuse more and smaller slices from existing packfiles, which may be much less efficient, but it is no immediately obvious to me if it leads to "need to disable". I would understand it if it were "it becomes much less efficient and we are better off not using the bitmap code at all", though.

Is the real reason why we want to disable the "reuse" because it is not easy to update the reuse_partial_packfile_from_bitmap() logic to take these selection options into account? If so, I would also understand why this is a good change.

Puzzled.
> This bug has been present since the inception of the
> pack-reuse code, but was unlikely to come up in practice.
Show 5 quoted lines
> +test_expect_success 'pack reuse respects --honor-pack-keep' '
> +	test_when_finished "rm -f .git/objects/pack/*.keep" &&
> +	for i in .git/objects/pack/*.pack; do
> +		>${i%.pack}.keep
> +	done &&
Micronit: style.
Previous: Jeff KingNext: Jeff King
Message 2 of 11 in “pack-objects: disable pack reuse for object-selection options”
  1. pack-objects: disable pack reuse for object-selection optionsJeff King, May 2, 2017
  2. Junio C HamanoMay 8, 2017
  3. Jeff KingMay 8, 2017
  4. Junio C HamanoMay 9, 2017
  5. Jeff KingMay 9, 2017
  6. Junio C HamanoMay 9, 2017
  7. Jeff KingMay 9, 2017
  8. Junio C HamanoMay 9, 2017
  9. Jeff KingMay 9, 2017
  10. Jeff KingMay 9, 2017
  11. Junio C HamanoMay 9, 2017

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.