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
Patrick Steinhardt <ps@pks.im>
Date
Aug 19, 2026, 10:01 UTC
Message-ID
<aoV--DSQq8-Krg3M@pks.im>
In-Reply-To
<xmqq5x17z41g.fsf@gitster.g>
On Tue, Aug 18, 2026 at 11:17:47AM -0700, Junio C Hamano wrote:
Show 14 quoted lines
> 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
Previous: Junio C HamanoNext: Junio C Hamano
Message 10 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.