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

[RFC] General object parsing

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Apr 18, 2005, 00:25 UTC
Message-ID
<Pine.LNX.4.21.0504171958520.30848-100000@iabervon.org>

After the fiasco with confusing struct revision for a struct commit, I've worked out something that makes more sense. I've actually ported fsck-cache, rev-tree, and my merge-base to it, so it should at least be comprehensive.

The design is as follows:

There is a struct object for each object in the database, although they are only created on demand. It contains the type and sha1 of the object, as well as a flag for whether the object contents have been read, more flags for general use, a list of objects which it references, and a flag for whether any objects reference it.

Each struct object is embedded in a type-specific struct, which contains further information. For example, struct commit has the date, the parents, and the tree.

Parsing objects is progressive; objects are created in an unread state (with no disk access), and functions can be called to parse each object as it is determined to be interesting. This should generally allow for only the necessary portions of a large set of object references to be read.

Any comment on the design, or should I send my implementation?
	-Daniel
*This .sig left intentionally blank*
Next: Linus Torvalds
Message 1 of 16 in “[RFC] General object parsing”
  1. Daniel BarkalowApr 18, 2005
  2. Linus TorvaldsApr 18, 2005
  3. Daniel BarkalowApr 18, 2005
  4. 0/5 Parsers for git objects, porting some programsDaniel Barkalow, Apr 18, 2005
  5. 1/5 Header files for object parsingDaniel Barkalow, Apr 18, 2005
  6. 2/5 Implementations of parsing functionsDaniel Barkalow, Apr 18, 2005
  7. 3/5 Port rev-tree to parsing functionsDaniel Barkalow, Apr 18, 2005
  8. 4/5 Port fsck-cache to use parsing functionsDaniel Barkalow, Apr 18, 2005
  9. 5/5 Switch implementations of merge-base, port to parsingDaniel Barkalow, Apr 18, 2005
  10. Linus TorvaldsApr 18, 2005
  11. Daniel BarkalowApr 18, 2005
  12. Junio C HamanoApr 19, 2005
  13. Daniel BarkalowApr 19, 2005
  14. Daniel BarkalowApr 19, 2005
  15. Daniel BarkalowApr 18, 2005
  16. David WoodhouseApr 18, 2005

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.