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

Re: [PATCH v2 0/4] [RFC] repack: add --filter=

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 23, 2022, 19:31 UTC
Message-ID
<xmqqv8x5v0qc.fsf@gitster.g>
In-Reply-To
<CAP8UFD3U4t-inWC5mZYhybWpjVwkqA7v4hYZ5voBOEJ=+_Y1kQ@mail.gmail.com>
Christian Couder <christian.couder@gmail.com> writes:
Show 9 quoted lines
>> For what it's worth, I am fine having a mode of repack which allows us
>> to remove objects that we know are stored by a promisor remote. But this
>> series doesn't do that, so users could easily run `git repack -d
>> --filter=...` and find that they have irrecoverably corrupted their
>> repository.
>
> In some cases we just know the objects we are removing are stored by a
> promisor remote or are replicated on different physical machines or
> both, so you should be fine with this.

So, we need to decide if an object we have that is outside the narrowed filter definition was (and still is, but let's keep the assumption the whole lazy clone mechanism makes: promisor remotes will never shed objects that they once served) available at the promisor remote, but I suspect we have too little information to reliably do so. It is OK to assume that objects in existing packs taken from the promisor remotes and everything reachable from them (but missing from our object store) will be available to us from there. But if we see an object that is outside of _new_ filter spec (e.g. you fetched with "max 100MB", now you are refiltering with "max 50MB", narrowing the spec, and you need to decide for an object that weigh 70MB), can we tell if that can be retrieved from the promisor or is it unique to our repository until we push it out? I am not sure. For that matter, do we even have a way to compare if the new filter spec is a subset, a superset, or neither, of the original filter spec?

> If you are not fine with this because sometimes a user might use it
> without knowing, then why are you ok with commands deleting refs not
> checking that there isn't a regular repack removing dangling objects?

Sorry, I do not follow this argument. Your user may do "branch -D" because the branch deleted is no longer needed, which may mean that objects only reachable from the deleted branch are no longer needed. I do not see what repack has anything to do with that. As long as the filter spec does not change (in other words, before this series is applied), the repack that discards objects that are known to be reachable from objects in packs retrieved from promisor remote, the objects that are no longer reachable may be removed and that will not lose objects that we do not know to be retrievable from there (which is different from objects that we know are unretrievable). But with filter spec changing after the fact, I am not sure if that is safe. IOW, "commands deleting refs" may have been OK without this series, but this series may be what makes it not OK, no?

Puzzled.
Previous: Robert CoupNext: John Cai
Message 26 of 34 in “repack: add --filter=”
  1. 0/2 repack: add --filter=John Cai via GitGitGadget, Jan 27, 2022
  2. 1/2 pack-objects: allow --filter without --stdoutJohn Cai via GitGitGadget, Jan 27, 2022
  3. 2/2 repack: add --filter=<filter-spec> optionJohn Cai via GitGitGadget, Jan 27, 2022
  4. Derrick StoleeJan 27, 2022
  5. John CaiJan 29, 2022
  6. Christian CouderJan 30, 2022
  7. John CaiJan 30, 2022
  8. 0/4 [RFC] repack: add --filter=John Cai via GitGitGadget, Feb 9, 2022
  9. 2/4 repack: add --filter=<filter-spec> optionJohn Cai via GitGitGadget, Feb 9, 2022
  10. John CaiFeb 9, 2022
  11. 3/4 upload-pack: allow missing promisor objectsJohn Cai via GitGitGadget, Feb 9, 2022
  12. 1/4 pack-objects: allow --filter without --stdoutJohn Cai via GitGitGadget, Feb 9, 2022
  13. 4/4 tests for repack --filter modeJohn Cai via GitGitGadget, Feb 9, 2022
  14. Robert CoupFeb 17, 2022
  15. John CaiFeb 17, 2022
  16. Robert CoupFeb 16, 2022
  17. John CaiFeb 16, 2022
  18. Taylor BlauFeb 21, 2022
  19. Robert CoupFeb 21, 2022
  20. Taylor BlauFeb 21, 2022
  21. Christian CouderFeb 21, 2022
  22. Taylor BlauFeb 21, 2022
  23. Christian CouderFeb 22, 2022
  24. Taylor BlauFeb 22, 2022
  25. Robert CoupFeb 23, 2022
  26. Junio C HamanoFeb 23, 2022
  27. John CaiFeb 26, 2022
  28. Taylor BlauFeb 26, 2022
  29. John CaiFeb 26, 2022
  30. Taylor BlauFeb 26, 2022
  31. John CaiFeb 26, 2022
  32. Taylor BlauFeb 26, 2022
  33. John CaiFeb 22, 2022
  34. Taylor BlauFeb 22, 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.