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

Re: Shallow clone

From
Junio C Hamano <junkio@cox.net>
Date
Nov 12, 2006, 08:16 UTC
Message-ID
<7vu015f5av.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<87zmaynl18.fsf@wine.dyndns.org>
Alexandre Julliard <julliard@winehq.org> writes:
> There's also a problem with the packing, a clone --depth 1 currently
> results in a pack that's about 3 times as large as it should be.
That's interesting.
  : gitster; git clone -n --depth 1 git://127.0.0.1/git.git victim-001
  remote: Generating pack...
  remote: Done counting 6246 objects.
  remote: Deltifying 6246 objects.
  remote:  100% (6246/6246) done
  Indexing 6246 objects.
  remote: Total 6246, written 6246 (delta 3106), reused 4313 (delta 3106)
   100% (6246/6246) done
  Resolving 3106 deltas.
   100% (3106/3106) done
  : gitster; cd victim-001
  : gitster; ls -lh .git/objects/pack/
  total 9.6M
  drwxrwsr-x 2 junio src 4.0K 2006-11-11 23:52 ./
  drwxrwsr-x 4 junio src 4.0K 2006-11-11 23:52 ../
  -r--r--r-- 1 junio src 148K 2006-11-11 23:52 pack-f5f88d83....idx
  -r--r--r-- 1 junio src 9.5M 2006-11-11 23:52 pack-f5f88d83....pack

Repacking immediately after cloning brings it down to what is expected.

  : gitster; git repack -a -d -f
  Generating pack...
  Done counting 6246 objects.
  Deltifying 6246 objects.
   100% (6246/6246) done
  Writing 6246 objects.
   100% (6246/6246) done
  Total 6246, written 6246 (delta 4815), reused 1407 (delta 0)
  Pack pack-f5f88d83524213e3ab05697ff75f245b1ef9081a created.
  : gitster; ls -lh .git/objects/pack/
  total 2.8M
  drwxrwsr-x 2 junio src 4.0K 2006-11-11 23:53 ./
  drwxrwsr-x 4 junio src 4.0K 2006-11-11 23:52 ../
  -rw-rw-r-- 1 junio src 148K 2006-11-11 23:53 pack-f5f88d83....idx
  -rw-rw-r-- 1 junio src 2.6M 2006-11-11 23:53 pack-f5f88d83....pack

In any case, after this "shallow" stuff, repeated "fetch --depth 99" seems to fetch 0 object and 3400 objects alternately, and the shallow file alternates between 900 bytes and 11000 bytes.

We would need to take a deeper look into what this series does, before moving it to 'next'.

Previous: Alexandre JulliardNext: Sergey Vlasov
Message 8 of 20 in “What's in git.git”
  1. Junio C HamanoNov 8, 2006
  2. David LangNov 8, 2006
  3. Shallow clone [Was Re: What's in git.git ]Aneesh Kumar K.V, Nov 8, 2006
  4. Aneesh Kumar K.VNov 8, 2006
  5. Junio C HamanoNov 9, 2006
  6. Aneesh KumarNov 9, 2006
  7. Alexandre JulliardNov 11, 2006
  8. Junio C HamanoNov 12, 2006
  9. Sergey VlasovNov 12, 2006
  10. Junio C HamanoNov 12, 2006
  11. Junio C HamanoNov 13, 2006
  12. Petr BaudisNov 12, 2006
  13. Junio C HamanoNov 12, 2006
  14. Johannes SchindelinNov 12, 2006
  15. Jakub NarebskiNov 8, 2006
  16. Junio C HamanoNov 8, 2006
  17. Jakub NarebskiNov 8, 2006
  18. Junio C HamanoNov 8, 2006
  19. Petr BaudisNov 8, 2006
  20. Junio C HamanoNov 9, 2006

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.