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

Re: Low-level repository inspection (Re: Where do I stick development documentation?)

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 12, 2010, 03:57 UTC
Message-ID
<20100812035733.GA19676@burratino>
In-Reply-To
<AANLkTikpT=PD0Q8d=6=989N6rxYXH-Le3Go_szAz-t4s@mail.gmail.com>
Ævar Arnfjörð Bjarmason wrote:
Show 6 quoted lines
> Those are part of the way there, but you often have to tease info out
> of them, e.g. if you want a commit -> commit roundtrip:
> 
>     $ echo 7980e417 | git cat-file --batch | perl -0777 -pe 's/.*
> commit ([0-9]*).(.*)\n/commit $1\0$2/s'|sha1sum
>     7980e41746bc5de91eea775f9142ce44b1100361  -
hash-object -w (and other “manipulation commands”)?
Show 5 quoted lines
> It'd be nice to answer "how are object stored" with something like:
> 
>     $ echo 7980e417 | git some-thing --pretty=raw -
>     commit <SP> 525 <NULL>
>     tree ....

Part of the reason I mention these interfaces is that if people use them (or something like them --- e.g., JGit) then it becomes a lot easier for low-level details of git to evolve.

That is part of why git uses zlib instead of gzip for its loose objects, if I remember correctly.

Previous: Ævar Arnfjörð BjarmasonNext: Michael Witten
Message 6 of 11 in “Where do I stick development documentation?”
  1. Ævar Arnfjörð BjarmasonAug 11, 2010
  2. Jonathan NiederAug 12, 2010
  3. Ævar Arnfjörð BjarmasonAug 12, 2010
  4. Low-level repository inspection (Re: Where do I stick development documentation?)Jonathan Nieder, Aug 12, 2010
  5. Ævar Arnfjörð BjarmasonAug 12, 2010
  6. Jonathan NiederAug 12, 2010
  7. Michael WittenAug 12, 2010
  8. Ævar Arnfjörð BjarmasonAug 12, 2010
  9. Jonathan NiederAug 12, 2010
  10. Jonathan NiederAug 12, 2010
  11. Ævar Arnfjörð BjarmasonAug 12, 2010

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.