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

Re: [GSoC PATCH v2 0/7] repack: add --drop-filtered to reclaim space in partial clones

From
Siddharth Shrimali <r.siddharth.shrimali@gmail.com>
Date
Aug 1, 2026, 18:19 UTC
Message-ID
<CAGWgyh8EPSufBZrk0xCqTr4gz6MtJHkfCy6JQKxCqKSPZ3gEgw@mail.gmail.com>
In-Reply-To
<xmqqcxw3dvh5.fsf@gitster.g>

Hi, thanks for the review Junio!

On Fri, 31 Jul 2026 at 21:04, Junio C Hamano <gitster@pobox.com> wrote:
> By 'by construction', do you mean 'It is guaranteed recoverable, as
> long as ODB_FOR_EACH_OBJECT_PROMISOR_ONLY is working correctly'?

yes, that is what I meant. the object is recoverable because it came from a promisor pack (due to a .promisor file), so the remote has promised to give it back. "by construction" means "recoverable as long as the promisor-only walk correctly picks out promisor objects".

> Since I do not use it, I do not personally trust promisor-based
> traversal all that much, and it would be great if we could hear from
> other practitioners that this really works well.

i'll also be glad to hear from people who actually use partial clone about whether leaning on the promisor-only walk here is a good idea for now, until the remote-object-info side of the cat-file protocol lands, which would let us verify against the remote directly.

> This is sensible, as long as this repacking is done only with
> locally available data, without dynamically pulling in lazy objects
> from the promisor (which would defeat the whole point ;-)).

right, i made sure of that :) enumeration passes OBJECT_INFO_SKIP_FETCH_OBJECT on every object-info lookup, so it never triggers a lazy fetch. The rebuild is local too: it only repacks promisor objects that are already present. I confirmed this by tracing a real drop and by moving the promisor remote away entirely before a drop, it still completed, so it clearly did not need the remote

> Presumably, this rebuilding is done without an extra traversal,
> driven instead by the list of enumerated promisor objects we
> constructed above (excluding the unwanted ones)?

not quite, there are two walks right now. First, enumerate_promisor_blobs() walks the promisor objects to figure out what to drop. Then repack_promisor_objects() does its own promisor-only walk to rebuild the pack, skipping anything in that drop set. so the rebuild does use the drop set, but through a second walk, not by directly reusing the first list.

Show 8 quoted lines
> I wonder whether size is the only criterion we would want to use
> when choosing what to discard among objects we know the promisor can
> give us on-demand.  It is, of course, perfectly fine to make it the
> only condition in this first effort, but it would help to imagine
> what other criteria we might want in the future and how they would
> fit into the framework you establish with this series.  Ensuring
> that the framework is easily extensible with a future set of rules
> will keep us from painting ourselves into a corner.

true, i agree.. size (blob:limit) is the only rule for now, but its easy to imagine others: how old an object is or when it was last used, its path, its type, or whether its still reachable from the current branch. The design should handle those without much trouble. Enumeration builds a set of promisor objects, and then one step narrows that set down to what we actually drop. Right now that step is just the blob:limit filter. A new rule would plug in at the same spot, narrowing the same set, so the overall "list them, then pick what to drop" shape would not change

Show 8 quoted lines
> I assume you do not mean a race where an operation wants to write a
> blob, finds that an identical one that came from the promisor remote
> already exists locally, refrains from writing another copy, and the
> drop-filtered operation removes the blob at the right moment.
> Rather, you likely have in mind an operation that stops, gives
> control back to the user, and, while the user ponders the situation,
> the drop-filtered operation kicks in and removes the blobs involved
> in the operation in progress.  Am I reading you correctly?

um yes, the case i had in mind is the second one: an operation stops halfway, hands control back to the user, and drop-filtered runs in that gap and removes blobs the paused operation was using

Show 6 quoted lines
> Even in either of these situations, I do not quite see why the
> safeguards are necessary.  The operation completes, or stays stopped
> in the middle.  The user's next move (whether they issue a new
> command after completion or resume the interrupted operation) will
> automatically lazy-refetch what the drop-filtered operation
> discarded as needed, will it not?

yes, you got that right. Since the objects are promised, whatever gets dropped will just be lazy-refetched when the user runs the next command or resumes the operation. the guards avoid immediately re-downloading something we just dropped, (which we can call as some wasted work : )), and a network fetch in the middle of, say, resolving a merge. The index guard is the same story- the blob it protects would just be re-fetched by the next command anyway. So they are a convenience to avoid pointless re-fetching, not a correctness measure. I am happy to drop them or keep them clearly documented as just that, whichever the list prefers.

Thanks, Siddharth Shrimali

Previous: Junio C HamanoNext: Junio C Hamano
Message 31 of 76 in “repack: add --drop-filtered to reclaim space in partial clones”
  1. 0/7 repack: add --drop-filtered to reclaim space in partial clonesSiddharth Shrimali, Jul 16, 2026
  2. 1/7 builtin/repack.c: add --drop-filtered and --dry-run optionsSiddharth Shrimali, Jul 16, 2026
  3. Junio C HamanoJul 16, 2026
  4. Siddharth ShrimaliJul 17, 2026
  5. Siddharth AsthanaJul 23, 2026
  6. Christian CouderJul 18, 2026
  7. Siddharth ShrimaliJul 20, 2026
  8. 2/7 list-objects-filter: add list_objects_filter__filter_oidset()Siddharth Shrimali, Jul 16, 2026
  9. 3/7 repack-promisor: allow excluding objects from the rebuilt promisor packSiddharth Shrimali, Jul 16, 2026
  10. 4/7 builtin/repack: enumerate promisor blobs for --drop-filteredSiddharth Shrimali, Jul 16, 2026
  11. 5/7 t7706: test --drop-filtered enumeration and validationSiddharth Shrimali, Jul 16, 2026
  12. 6/7 builtin/repack: actually drop filtered promisor blobsSiddharth Shrimali, Jul 16, 2026
  13. Siddharth AsthanaJul 23, 2026
  14. Siddharth ShrimaliJul 25, 2026
  15. 7/7 repack-promisor: record dropped objects in a drop logSiddharth Shrimali, Jul 16, 2026
  16. Siddharth AsthanaJul 23, 2026
  17. Siddharth ShrimaliJul 25, 2026
  18. Siddharth AsthanaJul 23, 2026
  19. Siddharth ShrimaliJul 25, 2026
  20. 0/7 repack: add --drop-filtered to reclaim space in partial clonesSiddharth Shrimali, Jul 30, 2026
  21. 1/7 builtin/repack.c: add --drop-filtered and --dry-run optionsSiddharth Shrimali, Jul 30, 2026
  22. Siddharth AsthanaAug 4, 2026
  23. 2/7 list-objects-filter: add list_objects_filter__filter_oidset()Siddharth Shrimali, Jul 30, 2026
  24. 3/7 repack-promisor: allow excluding objects from the rebuilt promisor packSiddharth Shrimali, Jul 30, 2026
  25. 4/7 builtin/repack: enumerate promisor blobs for --drop-filteredSiddharth Shrimali, Jul 30, 2026
  26. 5/7 builtin/repack: actually drop filtered promisor blobsSiddharth Shrimali, Jul 30, 2026
  27. 6/7 builtin/repack: add safety guards for --drop-filteredSiddharth Shrimali, Jul 30, 2026
  28. Siddharth AsthanaAug 4, 2026
  29. 7/7 Documentation/git-repack: document --drop-filtered and --dry-runSiddharth Shrimali, Jul 30, 2026
  30. Junio C HamanoJul 31, 2026
  31. Siddharth ShrimaliAug 1, 2026
  32. Junio C HamanoAug 2, 2026
  33. Siddharth ShrimaliAug 2, 2026
  34. Siddharth AsthanaAug 4, 2026
  35. 0/7 repack: add --drop-filtered to reclaim space in partial clonesSiddharth Shrimali, Aug 6, 2026
  36. 1/7 builtin/repack.c: add --drop-filtered and --dry-run optionsSiddharth Shrimali, Aug 6, 2026
  37. 2/7 list-objects-filter: add list_objects_filter__filter_oidset()Siddharth Shrimali, Aug 6, 2026
  38. 3/7 repack-promisor: allow excluding objects from the rebuilt promisor packSiddharth Shrimali, Aug 6, 2026
  39. 4/7 builtin/repack: enumerate promisor blobs for --drop-filteredSiddharth Shrimali, Aug 6, 2026
  40. 5/7 builtin/repack: actually drop filtered promisor blobsSiddharth Shrimali, Aug 6, 2026
  41. 6/7 builtin/repack: add guards for --drop-filteredSiddharth Shrimali, Aug 6, 2026
  42. 7/7 Documentation/git-repack: document --drop-filtered and --dry-runSiddharth Shrimali, Aug 6, 2026
  43. Junio C HamanoAug 6, 2026
  44. Junio C HamanoAug 6, 2026
  45. Siddharth ShrimaliAug 7, 2026
  46. Junio C HamanoAug 7, 2026
  47. Siddharth ShrimaliAug 8, 2026
  48. 0/7 repack: add --drop-filtered to reclaim space in partial clonesSiddharth Shrimali, Aug 10, 2026
  49. 1/7 builtin/repack.c: add --drop-filtered and --dry-run optionsSiddharth Shrimali, Aug 10, 2026
  50. 2/7 list-objects-filter: add list_objects_filter__filter_oidset()Siddharth Shrimali, Aug 10, 2026
  51. Christian CouderAug 12, 2026
  52. Junio C HamanoAug 12, 2026
  53. Siddharth ShrimaliAug 12, 2026
  54. 3/7 repack-promisor: allow excluding objects from the rebuilt promisor packSiddharth Shrimali, Aug 10, 2026
  55. 4/7 builtin/repack: enumerate promisor blobs for --drop-filteredSiddharth Shrimali, Aug 10, 2026
  56. Christian CouderAug 12, 2026
  57. 5/7 builtin/repack: actually drop filtered promisor blobsSiddharth Shrimali, Aug 10, 2026
  58. 6/7 builtin/repack: add guards for --drop-filteredSiddharth Shrimali, Aug 10, 2026
  59. Christian CouderAug 12, 2026
  60. Siddharth ShrimaliAug 12, 2026
  61. 7/7 Documentation/git-repack: document --drop-filtered and --dry-runSiddharth Shrimali, Aug 10, 2026
  62. Christian CouderAug 12, 2026
  63. Junio C HamanoAug 11, 2026
  64. Siddharth ShrimaliAug 12, 2026
  65. 0/6 repack: add --drop-filtered to reclaim space in partial clonesSiddharth Shrimali, Aug 13, 2026
  66. 1/6 builtin/repack: add --drop-filtered and --dry-run optionsSiddharth Shrimali, Aug 13, 2026
  67. 2/6 list-objects-filter: add list_objects_filter__filter_oidset()Siddharth Shrimali, Aug 13, 2026
  68. 3/6 repack-promisor: allow excluding objects from the rebuilt promisor packSiddharth Shrimali, Aug 13, 2026
  69. 4/6 builtin/repack: enumerate promisor blobs for --drop-filteredSiddharth Shrimali, Aug 13, 2026
  70. 5/6 builtin/repack: actually drop filtered promisor blobsSiddharth Shrimali, Aug 13, 2026
  71. 6/6 builtin/repack: add guards for --drop-filteredSiddharth Shrimali, Aug 13, 2026
  72. Samuel BronsonSep 3, 2026
  73. Siddharth ShrimaliSep 4, 2026
  74. Christian CouderAug 14, 2026
  75. Junio C HamanoAug 14, 2026
  76. Siddharth ShrimaliAug 14, 2026

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.