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

Re: [PATCH] drop support for "experimental" loose objects

From
Jeff King <peff@peff.net>
Date
Nov 27, 2013, 19:03 UTC
Message-ID
<20131127190319.GA3540@sigill.intra.peff.net>
In-Reply-To
<xmqqeh61u0z9.fsf@gitster.dls.corp.google.com>
On Wed, Nov 27, 2013 at 10:57:14AM -0800, Junio C Hamano wrote:
Show 11 quoted lines
> > Yes, I think it is a reasonable addition to the streaming API. However,
> > I do not think there are any callsites which would currently want it.
> > All of the current users of stream_blob_to_fd use read_sha1_file as
> > their alternative, and not parse_object. So we are not verifying the
> > sha1 in either case (we may want to change that, of course, but that is
> > a bigger decision than just trying to bring streaming and non-streaming
> > code-paths into parity).
> 
> True. I am not offhand sure if we want to make read_sha1_file() to
> rehash, but I agree that it is a question different from what we are
> asking in this discussion.

I'm torn on that. Having git verify everything all the time is kind of cool. But it _does_ have a performance impact, and the vast majority of the time nothing got corrupted since the last time we looked at the object. It seems like periodically running "git fsck" is a smarter way of doing periodic checks.

We already are careful when objects are coming into the repository, and I think that is a sensible boundary (and I am increasingly of the opinion that running with transfer.fsckobjects off is not a good idea).

The checks in parse_object seem hack-ish to me, because they catch some random subset of the times we access objects (e.g., calling parse_object on a commit sha1 will check, but calling parse_commit on an unparsed commit struct will not). If anything, I'd suggest moving the checking down to read_sha1_file, which would add it fairly consistently everywhere, and then tying it to a config option (off for high performance, on for slower-but-meticulous).

-Peff
Previous: Junio C Hamano
Message 28 of 28 in “corrupt object memory allocation error”
  1. Joey HessNov 20, 2013
  2. Jeff KingNov 20, 2013
  3. Joey HessNov 20, 2013
  4. drop support for "experimental" loose objectsJeff King, Nov 21, 2013
  5. Jeff KingNov 21, 2013
  6. Duy NguyenNov 21, 2013
  7. Keshav KiniNov 21, 2013
  8. Jeff KingNov 21, 2013
  9. Junio C HamanoNov 21, 2013
  10. Jonathan NiederNov 23, 2013
  11. Jeff KingNov 23, 2013
  12. Jonathan NiederNov 23, 2013
  13. Joey HessNov 21, 2013
  14. Christian CouderNov 21, 2013
  15. Jeff KingNov 22, 2013
  16. Christian CouderNov 22, 2013
  17. Jeff KingNov 22, 2013
  18. Christian CouderNov 22, 2013
  19. Jeff KingNov 22, 2013
  20. Junio C HamanoNov 22, 2013
  21. Jeff KingNov 22, 2013
  22. Joey HessNov 22, 2013
  23. Jeff KingNov 24, 2013
  24. Jeff KingNov 24, 2013
  25. Junio C HamanoNov 25, 2013
  26. Jeff KingNov 27, 2013
  27. Junio C HamanoNov 27, 2013
  28. Jeff KingNov 27, 2013

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.