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

Re: git gc expanding packed data?

From
Nicolas Pitre <nico@cam.org>
Date
Aug 9, 2009, 02:56 UTC
Message-ID
<alpine.LFD.2.00.0908082246020.440@xanadu.home>
In-Reply-To
<m2tz0j154o.fsf@igel.home>
On Sat, 8 Aug 2009, Andreas Schwab wrote:
Show 13 quoted lines
> Nicolas Pitre <nico@cam.org> writes:
> 
> > It appears that the git installation serving clone requests for
> > git://gcc.gnu.org/git/gcc.git generates lots of unreferenced objects. I
> > just cloned it and the pack I was sent contains 1383356 objects (can be
> > determined with 'git show-index < .git/objects/pack/*.idx | wc -l').
> > However, there are only 978501 actually referenced objects in that
> > cloned repository ( 'git rev-list --all --objects | wc -l').  That makes
> > for 404855 useless objects in the cloned repository.
> 
> Those objects are not useless.  They are referenced by the remote refs
> on the remote side, which are not fetched by default.  If you clone a
> mirror of the repository you'll see no unreferenced objects.

If you do a clone using the git:// protocol and the server sends you only the ref for the trunk branch, then it should send you only objects reachable from that branch. Any extra objects sent by the server are useless to me and wastes my and everyone else's bandwidth, and on my next repack those objects are pruned anyway. The point of the git protocol is _not_ necessarily to send a copy of the remote pack file over, even during a clone.

Nicolas
Previous: Andreas SchwabNext: Andreas Schwab
Message 4 of 26 in “Re: git gc expanding packed data?”
  1. Andreas SchwabAug 8, 2009
  2. Hin-Tak LeungAug 8, 2009
  3. Andreas SchwabAug 8, 2009
  4. Nicolas PitreAug 9, 2009
  5. Andreas SchwabAug 9, 2009
  6. Jason MerrillSep 25, 2009
  7. Matthieu MoySep 25, 2009
  8. Jason MerrillSep 25, 2009
  9. Nicolas PitreSep 25, 2009
  10. Jason MerrillSep 25, 2009
  11. Nicolas PitreSep 25, 2009
  12. Jason MerrillSep 25, 2009
  13. Nicolas PitreSep 26, 2009
  14. make 'git clone' ask the remote only for objects it cares aboutNicolas Pitre, Sep 26, 2009
  15. Andreas SchwabSep 26, 2009
  16. Shawn O. PearceSep 26, 2009
  17. Nicolas PitreSep 27, 2009
  18. Jason MerrillSep 26, 2009
  19. Jason MerrillSep 26, 2009
  20. Nicolas PitreSep 27, 2009
  21. Nicolas PitreSep 27, 2009
  22. Shawn O. PearceSep 27, 2009
  23. Nicolas PitreSep 27, 2009
  24. Jason MerrillSep 27, 2009
  25. Nicolas PitreSep 28, 2009
  26. Hin-Tak LeungSep 26, 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.