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

Re: Bad objects error since upgrading GitHub servers to 1.6.1

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 28, 2009, 18:26 UTC
Message-ID
<7vmydbs2vo.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20090128161652.GK1321@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
> Actually, the only time where it *isn't* a corruption is when its
> input to "git bundle create A.bdl ... -not $SOMEBADID" as that is
> the exact same thing as coming from the other side via send-pack.
And notice that it is about a nagative ref.

Another case you may use an object ID that may or may not be good and it is not a corruption is when a Porcelain has an object ID obtained from somewhere, and wants to know if it is safe to use the object. After determining that the object itself exists (e.g. via "cat-file -t"), you run

	rev-list --objects $THAT_UNKNOWN_ID --not --all

to see if it is reachable from some of your own refs, or at least it is connected to them without gaps. If it errors out while traversing, you know it is bad; if it doesn't, you know you can merge one of the commits reachable from your refs with it and put the result in your ref without violating the ref-objects contract.

Notice that in this case, it is about a positive ref, and revision machinery is set to notice the breakage.

So in that sense, the existing semantics is internally consistent. The rules (I am not making up a new rule here, but just spelling out) are:

 (1) You cannot just pick a random object that happens to exist in your
     repository, traverse to the objects it refers to and expect
     everything exists;
 (2) If an object is reachable from any of your refs, however, you can
     expect everything reachable from that object exists.  Otherwise you
     have a corrupt repository [*1*]).
 (3) Your object store may have garbage objects that are not reachable
     from any of your refs and it is normal.
 (4) You can use random objects that may not be well connected as negative
     revs to limit the range of revs (and optionally objects reachable
     from them) listed by object traversal.  If they are well connected,
     they will affect the outcome, but it is not an error if they are
     leftover cruft that is not connected to the positive ones you start
     your listing traversal at.
[Footnote]

*1* You don't have to bring up grafts and shallow. People who know about them know they are ways to hide or deliberately introduce this type of corruption while keeping the system (mostly) working.

Previous: Jeff KingNext: Junio C Hamano
Message 36 of 43 in “Bad objects error since upgrading GitHub servers to 1.6.1”
  1. PJ HyettJan 27, 2009
  2. PJ HyettJan 27, 2009
  3. Johannes SchindelinJan 27, 2009
  4. Shawn O. PearceJan 27, 2009
  5. Junio C HamanoJan 27, 2009
  6. PJ HyettJan 28, 2009
  7. PJ HyettJan 28, 2009
  8. Junio C HamanoJan 28, 2009
  9. Junio C HamanoJan 28, 2009
  10. send-pack: Filter unknown commits from alternates of the remoteBjörn Steinbrink, Jan 28, 2009
  11. Junio C HamanoJan 28, 2009
  12. Junio C HamanoJan 28, 2009
  13. Björn SteinbrinkJan 28, 2009
  14. Junio C HamanoJan 28, 2009
  15. Junio C HamanoJan 28, 2009
  16. Junio C HamanoJan 28, 2009
  17. PJ HyettJan 28, 2009
  18. Shawn O. PearceJan 28, 2009
  19. Junio C HamanoJan 28, 2009
  20. Shawn O. PearceJan 28, 2009
  21. Stephen BannaschJan 28, 2009
  22. Shawn O. PearceJan 28, 2009
  23. Junio C HamanoJan 28, 2009
  24. Junio C HamanoJan 28, 2009
  25. Shawn O. PearceJan 28, 2009
  26. Junio C HamanoJan 28, 2009
  27. Junio C HamanoJan 28, 2009
  28. 1/2 send-pack: do not send unknown object name from ".have" to pack-objectsJunio C Hamano, Jan 28, 2009
  29. Linus TorvaldsJan 28, 2009
  30. Junio C HamanoJan 28, 2009
  31. Jeff KingJan 28, 2009
  32. Junio C HamanoJan 28, 2009
  33. Jeff KingJan 28, 2009
  34. Shawn O. PearceJan 28, 2009
  35. Jeff KingJan 28, 2009
  36. Junio C HamanoJan 28, 2009
  37. Junio C HamanoJan 28, 2009
  38. Jeff KingJan 28, 2009
  39. Shawn O. PearceJan 28, 2009
  40. Nicolas PitreJan 28, 2009
  41. Jeff KingJan 28, 2009
  42. Linus TorvaldsJan 28, 2009
  43. Björn SteinbrinkJan 28, 2009

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.