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

Re: Reading commit objects

From
Shawn Pearce <spearce@spearce.org>
Date
May 22, 2013, 20:02 UTC
Message-ID
<CAJo=hJuO23YGMJV69WvdKweW7EYCYVE-f93w5a=+N2_xh_e1+A@mail.gmail.com>
In-Reply-To
<CABx5MBS9YgNmZD_tumMJ-MJVjHbRFCKbCjs9AZ347-OCwqO7qQ@mail.gmail.com>
On Wed, May 22, 2013 at 7:20 AM, Chico Sokol <chico.sokol@gmail.com> wrote:
> I'm not criticizing JGit, guys. It simply doesn't fit into our needs.
> We're not interested in mapping git commands in java and don't have
> the same RAM limitations.

I guess you aren't trying to process the WebKit or Linux kernel repositories. Or you can afford more RAM than I can[1]. :-)

[1] $DAY_JOB has lots of RAM.  Lots.
> Are you guys contributors of JGit?
Not really. I had nothing to do with JGit.  :-)
> Can you guys point me out to the
> code that unpacks git objects? The closest I could get was that class:
> https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java

This class handles the loose object format in $GIT_DIR/objects, but does not handle objects contained in pack files. That is elsewhere, and well, more complex. Look at PackFile.java.

> It seems to be a standard and a non standard format of the packed
> object, as I read the comments of this method:
> https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/UnpackedObject.java#L272

There are two formats, the official format that is used, and an experimental format that was discarded but is still supported for legacy reasons.

Show 5 quoted lines
> I suspect that the default inflater class of java api expect the
> object to be in the standard format.
>
> What the following comment mean? What's the "Experimental pack-based"
> format? Is there any docs on the specs of that?

Read the code. This is the dead format that is no longer written, but is still supported.

Previous: Chico SokolNext: Chico Sokol
Message 15 of 19 in “Reading commit objects”
  1. Chico SokolMay 21, 2013
  2. Felipe ContrerasMay 21, 2013
  3. John SzakmeisterMay 21, 2013
  4. Chico SokolMay 21, 2013
  5. Junio C HamanoMay 21, 2013
  6. Chico SokolMay 21, 2013
  7. Jonathan NiederMay 21, 2013
  8. Shawn PearceMay 22, 2013
  9. java zlib woes (was: Reading commit objects)Andreas Krey, May 22, 2013
  10. Shawn PearceMay 22, 2013
  11. Andreas KreyMay 27, 2013
  12. fetch delta resolution vs. checkout (was: java zlib woes)Andreas Krey, Jun 4, 2013
  13. Shawn PearceMay 22, 2013
  14. Chico SokolMay 22, 2013
  15. Shawn PearceMay 22, 2013
  16. Chico SokolMay 22, 2013
  17. Chico SokolMay 22, 2013
  18. Shawn PearceMay 22, 2013
  19. Junio C HamanoMay 21, 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.