git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 17:03 UTC

Re: [GSoC PATCH v5 6/6] builtin/repack: add guards for --drop-filtered

From
Siddharth Shrimali <r.siddharth.shrimali@gmail.com>
Date
Sep 4, 2026, 10:51 UTC
Message-ID
<CAGWgyh9B=re06aofii9VFB1xOwEeTtxYE=7T14m9WFAx1ORpMg@mail.gmail.com>
In-Reply-To
<s0vqzjavw8p.fsf@gmail.com>

Hi Samuel, Thanks for the review and your RFC!

I have a few suggestions:
On Fri, 4 Sept 2026 at 03:24, Samuel Bronson <naesten@gmail.com> wrote:
Show 11 quoted lines
> > +                     for (i = 0; i < istate->cache_nr; i++) {
> > +                             const struct cache_entry *ce = istate->cache[i];
> > +
> > +                             if (oidset_contains(&drop_oids, &ce->oid))
> > +                                     die(_("cannot drop '%s' (%s): it is referenced by the current index"),
> > +                                             ce->name, oid_to_hex(&ce->oid));
>
> The bad news: dying at this time is *not* convenient, especially after
> we've finished that *entire* enumerate_promisor_blobs(), (which is kind
> of slow for a step with no progress output, btw).
>

Thats actually a very good point :) I agree with this: aborting the whole operation because a single blob is referenced by the index is a poor trade-off, since it happens only after the full enumerate_promisor_blobs() walk has already run.

> While I do want to keep the index blobs, I do *not* want to cancel the
> whole operation over them.

one caveat: oidset_remove() mutates drop_oids in place, and the --dry-run printer iterates drop_oids afterwards. So with this change, --dry-run would stop listing the index-referenced blobs, when it should still report them as candidates it would skip. Instead, we can collect the index OIDs into a separate 'skip-set' and have both the dry-run output and the real drop consult that, rather than removing from drop_oids directly.

As a follow-up note, the planned drop-log work will need to account for this: a blob skipped here was never dropped, so it must not be recorded there.

Show 16 quoted lines
> The following seems much more convenient:
>
> -- >8 --
> Subject: [RFC] builtin/repack: just don't --drop-filtered index blobs
>
> Instead of dying when we would drop a blob referenced by the index, just
> ... don't drop it. (Retain the explanatory message as a warning.)
>
> This allows `git repack -a --filter=blob:limit=0 --drop-filtered` to
> work in non-bare repositories that have non-trivial files around.
>
> Not done:
>
>   - Fixing the tests to match
>
>   - Allowing `--filter=blob:none`

Thanks, Siddharth Shrimali

Previous: Samuel Bronson
Message 76 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. 2/7 list-objects-filter: add list_objects_filter__filter_oidset()Siddharth Shrimali, Jul 16, 2026
  4. 3/7 repack-promisor: allow excluding objects from the rebuilt promisor packSiddharth Shrimali, Jul 16, 2026
  5. 4/7 builtin/repack: enumerate promisor blobs for --drop-filteredSiddharth Shrimali, Jul 16, 2026
  6. 5/7 t7706: test --drop-filtered enumeration and validationSiddharth Shrimali, Jul 16, 2026
  7. 6/7 builtin/repack: actually drop filtered promisor blobsSiddharth Shrimali, Jul 16, 2026
  8. 7/7 repack-promisor: record dropped objects in a drop logSiddharth Shrimali, Jul 16, 2026
  9. Junio C HamanoJul 16, 2026
  10. Siddharth ShrimaliJul 17, 2026
  11. Christian CouderJul 18, 2026
  12. Siddharth ShrimaliJul 20, 2026
  13. Siddharth AsthanaJul 23, 2026
  14. Siddharth AsthanaJul 23, 2026
  15. Siddharth AsthanaJul 23, 2026
  16. Siddharth AsthanaJul 23, 2026
  17. Siddharth ShrimaliJul 25, 2026
  18. Siddharth ShrimaliJul 25, 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. 2/7 list-objects-filter: add list_objects_filter__filter_oidset()Siddharth Shrimali, Jul 30, 2026
  23. 3/7 repack-promisor: allow excluding objects from the rebuilt promisor packSiddharth Shrimali, Jul 30, 2026
  24. 4/7 builtin/repack: enumerate promisor blobs for --drop-filteredSiddharth Shrimali, Jul 30, 2026
  25. 5/7 builtin/repack: actually drop filtered promisor blobsSiddharth Shrimali, Jul 30, 2026
  26. 6/7 builtin/repack: add safety guards for --drop-filteredSiddharth Shrimali, Jul 30, 2026
  27. 7/7 Documentation/git-repack: document --drop-filtered and --dry-runSiddharth Shrimali, Jul 30, 2026
  28. Junio C HamanoJul 31, 2026
  29. Siddharth ShrimaliAug 1, 2026
  30. Junio C HamanoAug 2, 2026
  31. Siddharth ShrimaliAug 2, 2026
  32. Siddharth AsthanaAug 4, 2026
  33. Siddharth AsthanaAug 4, 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. 3/7 repack-promisor: allow excluding objects from the rebuilt promisor packSiddharth Shrimali, Aug 10, 2026
  52. 4/7 builtin/repack: enumerate promisor blobs for --drop-filteredSiddharth Shrimali, Aug 10, 2026
  53. 5/7 builtin/repack: actually drop filtered promisor blobsSiddharth Shrimali, Aug 10, 2026
  54. 6/7 builtin/repack: add guards for --drop-filteredSiddharth Shrimali, Aug 10, 2026
  55. 7/7 Documentation/git-repack: document --drop-filtered and --dry-runSiddharth Shrimali, Aug 10, 2026
  56. Junio C HamanoAug 11, 2026
  57. Siddharth ShrimaliAug 12, 2026
  58. Christian CouderAug 12, 2026
  59. Christian CouderAug 12, 2026
  60. Christian CouderAug 12, 2026
  61. Christian CouderAug 12, 2026
  62. Junio C HamanoAug 12, 2026
  63. Siddharth ShrimaliAug 12, 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. Christian CouderAug 14, 2026
  73. Junio C HamanoAug 14, 2026
  74. Siddharth ShrimaliAug 14, 2026
  75. Samuel BronsonSep 3, 2026
  76. Siddharth ShrimaliSep 4, 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.