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

Re: [kernel.org users] Re: auto-packing on kernel.org? please?

From
Junio C Hamano <junkio@cox.net>
Date
Oct 17, 2005, 08:21 UTC
Message-ID
<7voe5o366d.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20051017060659.GH5509@reactrix.com>
Nick Hengeveld <nickh@reactrix.com> writes:
> To get a complete list of objects we do not have yet, fetch will need
> to walk all the trees first and then make another pass to process
> all the missing objects.

Notice I did not say "we do not have yet but we will need" -- I just said "we do not have yet".

The assumption, which is the property the suggested packing strategy has, is that older objects that are needed to complete the history leading to the current tip are packed in those n-month/n-week packs, so if we do not have them we would likely be needing them, although we might not have walked that far back in history yet.

The previous "packing strategy" picture was certainly too simplified. Obviously we would not want to repack everything every week for different periods all the way back -- we would want to leave old huge pack untouched to help server side (and mirroring), so instead of having a single "pack optimization boundary", we would probably need some staggering as well for archived material.

This is a revised example.

1yr ----- 9mo -------- 6mo ---------- 3mo ------------------ 1mo ------------ 2wk -------- 1wk ----

We keep track of "the current heads and tags" for each week. Every week, we can do something like this:

 - rotate the record, and create a new one:
   mv .save/wk11 .save/wk12
   mv .save/wk10 .save/wk11
   mv .save/wk9 .save/wk10
   ...
   mv .save/wk0 .save/wk1
   find .git/refs -type f -print | xargs cat >.save/wk0
 
 - prepare a pack to allow a single pack fetch to bring a
   repository that had everything reachable from wk$N refs
   up-to-date to the current, for selected recent weeks (say N=1,
   2, 4, 12):
   for N in 1 2 4 12
   do
       name=$(git-rev-list --objects \
                 $(sed -e 's/^/^/' .save/wk$N) \
                 $(cat .save/wk0) |
              git-pack-object pack-) &&
       mv pack-$name.* .git/objects/pack/.
   done
   remove the pack files that we created this way last week from
   the repository (if the repository did not have any activity
   during the last week we would have created the same set of
   packs.  make sure we do not remove them).
 - except that, we keep the longest period (i.e. N=12 in this
   example) one every N weeks (that's how 1yr, 9mo, 6mo packs in
   the picture are kept).

This way, really old stuff (say, older than 3mo) will stay intact and will not be repacked, so people reasonably up-to-date (within 12 weeks in the example) need to fetch only one pack (and unpacked objects since the last pack optimization), but people without the ancient history need to go further back.

Previous: Nick HengeveldNext: Nick Hengeveld
Message 24 of 33 in “auto-packing on kernel.org? please?”
  1. Linus TorvaldsOct 13, 2005
  2. Carl BaldwinNov 21, 2005
  3. Linus TorvaldsNov 21, 2005
  4. Junio C HamanoNov 21, 2005
  5. Linus TorvaldsNov 21, 2005
  6. Junio C HamanoNov 21, 2005
  7. Chuck LeverNov 22, 2005
  8. Linus TorvaldsNov 22, 2005
  9. Catalin MarinasNov 22, 2005
  10. Linus TorvaldsNov 22, 2005
  11. Chuck LeverNov 22, 2005
  12. Catalin MarinasNov 23, 2005
  13. Carl BaldwinNov 22, 2005
  14. Linus TorvaldsNov 22, 2005
  15. Linus TorvaldsOct 13, 2005
  16. Dirk BehmeOct 16, 2005
  17. Daniel BarkalowOct 16, 2005
  18. Nick HengeveldOct 16, 2005
  19. Brian GerstOct 16, 2005
  20. Junio C HamanoOct 16, 2005
  21. Nick HengeveldOct 16, 2005
  22. Junio C HamanoOct 16, 2005
  23. Nick HengeveldOct 17, 2005
  24. Junio C HamanoOct 17, 2005
  25. Nick HengeveldOct 17, 2005
  26. Junio C HamanoOct 17, 2005
  27. Daniel BarkalowOct 17, 2005
  28. Linus TorvaldsOct 17, 2005
  29. Nick HengeveldOct 17, 2005
  30. Daniel BarkalowOct 17, 2005
  31. Johannes SchindelinOct 16, 2005
  32. Brian GerstOct 16, 2005
  33. Catalin MarinasNov 23, 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.