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

Re: Understanding pack format

From
Duy Nguyen <pclouds@gmail.com>
Date
Nov 6, 2018, 16:06 UTC
Message-ID
<CACsJy8AYtz2tjo5ZB_6Mj9MWaUnYGs4GUO2+6E6nDKiNzrJoAg@mail.gmail.com>
In-Reply-To
<CAFd4kYDcX2BOYvMg1X9zO68EfYYE6Zke_-9CGY-Yi01jCc3EPA@mail.gmail.com>
On Tue, Nov 6, 2018 at 3:23 AM Farhan Khan <khanzf@gmail.com> wrote:
> To follow-up from the other day, I have been reading the code that
> retrieves the pack entry for the past 3 days now without much success.
> But there are quite a few abstractions and I get lost half-way down
> the line.
Jeff already gave you some pointers. This is just a side note.

I think it's easier to run the code under a debugger and see what it does than just reading it. You can create a repo with just one blob to have better control over it (small packs also make it possible to examine with a hex editor in parallel), e.g.

git init foo cd foo echo hello >file git add file git repack -ad gdb --args git show :./file

then put a breakpoint in some interesting functions (perhaps one of those Jeff pointed out)

-- 
Duy
Previous: Jeff KingNext: Duy Nguyen
Message 6 of 7 in “Understanding pack format”
  1. Farhan KhanNov 2, 2018
  2. Junio C HamanoNov 2, 2018
  3. Duy NguyenNov 2, 2018
  4. Farhan KhanNov 6, 2018
  5. Jeff KingNov 6, 2018
  6. Duy NguyenNov 6, 2018
  7. Duy NguyenNov 2, 2018

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.