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

Re: [PATCH 3/7] odb/source-packed: flag known-bad objects as corrupt and not missing

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 19, 2026, 17:42 UTC
Message-ID
<xmqqpkzeuhuz.fsf@gitster.g>
In-Reply-To
<aoV--DSQq8-Krg3M@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 26 quoted lines
> On Tue, Aug 18, 2026 at 11:17:47AM -0700, Junio C Hamano wrote:
>> Patrick Steinhardt <ps@pks.im> writes:
>> > @@ -618,8 +619,11 @@ int fill_midx_entry(struct multi_pack_index *m,
>> >  		return 0;
>> >  
>> >  	if (oidset_size(&p->bad_objects) &&
>> > -	    oidset_contains(&p->bad_objects, oid))
>> > +	    oidset_contains(&p->bad_objects, oid)) {
>> > +		if (bad_pack && !*bad_pack)
>> > +			*bad_pack = p;
>> >  		return 0;
>> > +	}
>> 
>> Hmph, so the idea is that if you have even one bad thing, you are
>> marked as bad, because who knows what other parts of you are broken?
>
> No, not quite. We don't mark the whole pack itself as bad, we only mark
> the objects that's contained in there as bad. The only reason why we
> also bubble up the pack is so that we can provide a better error message
> in a subsequent commit, where we can then tell the user which pack it
> was specifically that contains the bad commit.
>
> That's by itself not visible in this commit yet, but I do mention it as
> part of the commit message.
>
> Patrick
OK.

This is a tangent but the argument heavily relies on the invariant that a single pack can contain one object at most once. Once a corrupt pack that has copies of the same object duplicated in it comes into the picture, the error message has to say which copy is bad.

Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 11 of 18 in “odb: handle `OBJECT_INFO_DIE_IF_CORRUPT` generically”
  1. 0/7 odb: handle `OBJECT_INFO_DIE_IF_CORRUPT` genericallyPatrick Steinhardt, Aug 18, 2026
  2. 1/7 odb/source: discern missing and corrupt objectsPatrick Steinhardt, Aug 18, 2026
  3. Junio C HamanoAug 18, 2026
  4. Patrick SteinhardtAug 19, 2026
  5. 2/7 odb/source-inmemory: signal missing objects via positive returnPatrick Steinhardt, Aug 18, 2026
  6. Junio C HamanoAug 18, 2026
  7. Patrick SteinhardtAug 19, 2026
  8. 3/7 odb/source-packed: flag known-bad objects as corrupt and not missingPatrick Steinhardt, Aug 18, 2026
  9. Junio C HamanoAug 18, 2026
  10. Patrick SteinhardtAug 19, 2026
  11. Junio C HamanoAug 19, 2026
  12. 4/7 odb/source-loose: distinguish missing and corrupt objectsPatrick Steinhardt, Aug 18, 2026
  13. Junio C HamanoAug 18, 2026
  14. 5/7 odb/source-files: signal mark objects via positive returnPatrick Steinhardt, Aug 18, 2026
  15. Junio C HamanoAug 18, 2026
  16. Patrick SteinhardtAug 19, 2026
  17. 6/7 odb/source: allow `read_object_info()` to bubble up error messagesPatrick Steinhardt, Aug 18, 2026
  18. 7/7 odb: handle `OBJECT_INFO_DIE_IF_CORRUPT` genericallyPatrick Steinhardt, Aug 18, 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.