{"thread":{"id":"66828","subject":"[BUG] repack --drop-filtered aborts when a filtered blob is referenced by the index","startedAt":"2026-11-11T16:51:07Z","lastAt":"2026-11-12T07:29:21Z","messageCount":2,"participants":["kongfankaikai","Siddharth Shrimali"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"558239","messageId":"tencent_AC7FF23968DCD0078A6B863A42BCB5ED4E05@qq.com","threadId":"66828","inReplyTo":null,"subject":"[BUG] repack --drop-filtered aborts when a filtered blob is referenced by the index","fromName":"kongfankaikai","fromEmail":"kongfankaikai@foxmail.com","sentAt":"2026-11-11T16:51:07Z","receivedAt":"2026-11-11T16:51:07Z","isPatch":false,"sender":{"key":"kongfankaikai@foxmail.com","avatar":null},"body":"Hi Git developers,\n\nI ran into an issue using `git repack --drop-filtered` in a partial clone repository.\n\nProblem\n\nWhen a blob selected by the filter for dropping is referenced by the current index, Git aborts the entire repack with:\n\n`fatal: cannot drop 'path/to/large-file.bin' (object-id): it is referenced by the current index`\n\nThis stops other eligible blobs from being dropped, even though those blobs are not referenced by the index.\n\nExpected behavior\n\nI’m wondering if Git could skip blobs referenced by the index and continue dropping the rest of the eligible objects, instead of aborting the whole operation.\n\nFor example:\n\nBlob A: eligible for dropping, not referenced by index → drop\n\nBlob B: eligible for dropping, referenced by index → skip\n\nBlob C: eligible for dropping, not referenced by index → drop\n\nThe repack could complete successfully, optionally emitting a warning for skipped blobs.\n\nQuestion\n\nIs there a specific reason this condition is treated as fatal rather than skipping the affected objects?\n\nThis behavior would be especially helpful for partial clones with large working trees.\n\nThanks!\n\n\n\n\n"},{"id":"558278","messageId":"20261112072921.19170-1-r.siddharth.shrimali@gmail.com","threadId":"66828","inReplyTo":"tencent_AC7FF23968DCD0078A6B863A42BCB5ED4E05@qq.com","subject":"Re: [BUG] repack --drop-filtered aborts when a filtered blob is referenced by the index","fromName":"Siddharth Shrimali","fromEmail":"r.siddharth.shrimali@gmail.com","sentAt":"2026-11-12T07:29:21Z","receivedAt":"2026-11-12T07:29:21Z","isPatch":false,"sender":{"key":"r.siddharth.shrimali@gmail.com","avatar":"https://avatars.githubusercontent.com/u/183274193?v=4"},"body":"Hi,\n\nOn Thu, Nov 12, 2026 at 12:51:07AM +0800, kongfankaikai wrote:\n> When a blob selected by the filter for dropping is referenced by the\n> current index, Git aborts the entire repack with:\n>\n> `fatal: cannot drop 'path/to/large-file.bin' (object-id): it is\n> referenced by the current index`\n>\n> This stops other eligible blobs from being dropped, even though those\n> blobs are not referenced by the index.\n\nThanks for the report. This is a known limitation and a fix is already\nplanned.\n\nSamuel Bronson ran into exactly the same thing on a real llvm-project\nclone and sent an RFC patch for it in September:\n\n  https://lore.kernel.org/git/s0vqzjavw8p.fsf@gmail.com/\n\nand I agreed with the direction there:\n\n  https://lore.kernel.org/git/CAGWgyh9B=re06aofii9VFB1xOwEeTtxYE=7T14m9WFAx1ORpMg@mail.gmail.com/\n\n> Is there a specific reason this condition is treated as fatal rather\n> than skipping the affected objects?\n>\n> This behavior would be especially helpful for partial clones with\n> large working trees.\n\nNo correctness reason. The guard only avoids dropping a blob that the\nnext command would lazy-fetch right back, so such a blob is never at\nrisk. Aborting was simply a conservative version of the guard, and as\nyou and Samuel point out it is a poor trade-off.\n\nThe fix is to replace the die() with a warning and drop the remaining\neligible blobs. I am working on this and will post it to the list.\n\nThanks,\nSiddharth \n\n"}]}