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

Re: Continue git clone after interruption

From
Jakub Narebski <jnareb@gmail.com>
Date
Aug 19, 2009, 15:19 UTC
Message-ID
<200908191719.52974.jnareb@gmail.com>
In-Reply-To
<alpine.LFD.2.00.0908181711350.6044@xanadu.home>
On Tue, 18 Aug 2009, Nicolas Pitre wrote:
Show 19 quoted lines
> On Tue, 18 Aug 2009, Jakub Narebski wrote:
> 
>> You can probably get number and size taken by delta and non-delta (base)
>> objects in the packfile somehow.  Neither "git verify-pack -v <packfile>"
>> nor contrib/stats/packinfo.pl did help me arrive at this data.
> 
> Documentation for verify-pack says:
> 
> |When specifying the -v option the format used is:
> |
> |        SHA1 type size size-in-pack-file offset-in-packfile
> |
> |for objects that are not deltified in the pack, and
> |
> |        SHA1 type size size-in-packfile offset-in-packfile depth base-SHA1
> |
> |for objects that are deltified.
> 
> So a simple script should be able to give you the answer.
Thanks.

There are 114937 objects in this packfile, including 56249 objects used as base (can be deltified or not). git-verify-pack -v shows that all objects have total size-in-packfile of 33 MB (which agrees with packfile size of 33 MB), with 17 MB size-in-packfile taken by deltaified objects, and 16 MB taken by base objects.

  git verify-pack -v | 
    grep -v "^chain" | 
    grep -v "objects/pack/pack-" > verify-pack.out
  sum=0; bsum=0; dsum=0; 
  while read sha1 type size packsize off depth base; do
    echo "$sha1" >> verify-pack.sha1.out
    sum=$(( $sum + $packsize ))
    if [ -n "$base" ]; then 
       echo "$sha1" >> verify-pack.delta.out
       dsum=$(( $dsum + $packsize ))
    else
       echo "$sha1" >> verify-pack.base.out
       bsum=$(( $bsum + $packsize ))
    fi
  done < verify-pack.out
  echo "sum=$sum; bsum=$bsum; dsum=$dsum"
 
>>>> (BTW what happens if this pack is larger than file size limit for 
>>>> given filesystem?).
[...]
Show 7 quoted lines
>> If I remember correctly FAT28^W FAT32 has maximum file size of 2 GB.
>> FAT is often used on SSD, on USB drive.  Although if you have  2 GB
>> packfile, you are doing something wrong, or UGFWIINI (Using Git For
>> What It Is Not Intended).
> 
> Hopefully you're not performing a 'git clone' off of a FAT filesystem.  
> For physical transport you may repack with the appropriate switches.
Not off a FAT filesystem, but into a FAT filesystem.
 
[...]
Show 10 quoted lines
>>> I think it is better to "prime" the repository with the content of the 
>>> top commit in the most straight forward manner using git-archive which 
>>> has the potential to be fully restartable at any point with little 
>>> complexity on the server side.
>> 
>> But didn't it make fully restartable 2.5 MB part out of 37 MB packfile?
> 
> The front of the pack is the critical point.  If you get enough to 
> create the top commit then further transfers can be done incrementally 
> with only the deltas between each commits.

How? You have some objects that can be used as base; how to tell git-daemon that we have them (but not theirs prerequisites), and how to generate incrementals?

Show 8 quoted lines
>> A question about pack protocol negotiation.  If clients presents some
>> objects as "have", server can and does assume that client has all 
>> prerequisites for such objects, e.g. for tree objects that it has
>> all objects for files and directories inside tree; for commit it means
>> all ancestors and all objects in snapshot (have top tree, and its 
>> prerequisites).  Do I understand this correctly?
> 
> That works only for commits.
Hmmmm... how do you intent for "prefetch top objects restartable-y first"
to work, then?
 
>> BTW. because of compression it might be more difficult to resume 
>> archive creation in the middle, I think...
> 
> Why so?  the tar+gzip format is streamable.

gzip format uses sliding window in compression. "cat a b | gzip" is different from "cat <(gzip a) <(gzip b)".

But that doesn't matter. If we are interrupted in the middle, we can uncompress what we have to check how far did we get, and tell server to send the rest; this way server wouldn't have to even generate (but not send) what we get as partial transfer.

P.S. What do you think about 'bundle' capability extension mentioned
     in a side sub-thread?
-- 
Jakub Narebski
Poland
Previous: Nicolas PitreNext: Nicolas Pitre
Message 11 of 39 in “Continue git clone after interruption”
  1. Tomasz KontuszAug 17, 2009
  2. Johannes SchindelinAug 17, 2009
  3. Shawn O. PearceAug 17, 2009
  4. Matthieu MoyAug 18, 2009
  5. Tomasz KontuszAug 18, 2009
  6. Nicolas PitreAug 18, 2009
  7. Jakub NarebskiAug 18, 2009
  8. Nicolas PitreAug 18, 2009
  9. Jakub NarebskiAug 18, 2009
  10. Nicolas PitreAug 18, 2009
  11. Jakub NarebskiAug 19, 2009
  12. Nicolas PitreAug 19, 2009
  13. Jakub NarebskiAug 19, 2009
  14. Nicolas PitreAug 19, 2009
  15. Sam VilainAug 20, 2009
  16. Jakub NarebskiAug 20, 2009
  17. Nguyen Thai Ngoc DuyAug 20, 2009
  18. Jakub NarebskiAug 20, 2009
  19. Nicolas PitreAug 20, 2009
  20. Jakub NarebskiAug 21, 2009
  21. Matthieu MoyAug 21, 2009
  22. Nicolas PitreAug 21, 2009
  23. Jakub NarebskiAug 21, 2009
  24. Nicolas PitreAug 22, 2009
  25. Sam VilainAug 21, 2009
  26. Nicolas PitreAug 22, 2009
  27. Sam VilainAug 22, 2009
  28. Nicolas PitreAug 22, 2009
  29. Sam VilainAug 23, 2009
  30. Sam VilainAug 20, 2009
  31. Johannes SchindelinAug 18, 2009
  32. Nicolas PitreAug 18, 2009
  33. Johannes SchindelinAug 19, 2009
  34. Nguyen Thai Ngoc DuyAug 19, 2009
  35. Johannes SchindelinAug 19, 2009
  36. Nicolas PitreAug 19, 2009
  37. =?VISCII?Q?Ren=E9_Scharfe?=Aug 19, 2009
  38. Sitaram ChamartyAug 19, 2009
  39. Jakub NarebskiAug 19, 2009

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.