{"thread":{"id":"32127","subject":"cloning a namespace downloads all the objects","startedAt":"2012-11-16T16:34:41Z","lastAt":"2012-11-16T17:34:18Z","messageCount":3,"participants":["Sitaram Chamarty","Junio C Hamano","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"203348","messageId":"CAMK1S_hdsgXoPcSn__htpGCpmCsAGb9j+m+SvxtO_69eqC92gA@mail.gmail.com","threadId":"32127","inReplyTo":null,"subject":"cloning a namespace downloads all the objects","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2012-11-16T16:34:41Z","receivedAt":"2012-11-16T16:34:41Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"Hi,\n\nI have a repo on a server, which contains, as namespaces, the contents\nof several different repos of varying sizes.  When I run a clone\ncommand for the smallest of the namespaces (I have a script that\nintercepts the clone and sets GIT_NAMESPACE appropriately), I get the\ncorrect set of refs, but *all* the objects from *all* the namespaces.\n\nAnd since no refs from the other namespaces have come down, a 'git gc\n--prune=now', run immediately after, reduces the size of\n\".git/objects\" to the size I would expect for just that small\nnamespace.\n\nIn effect, it is bringing down data that is not reachable and will be\nwiped out on the next gc.\n\nIs this expected?\n\n-- \nSitaram\n"},{"id":"203349","messageId":"7vvcd57b32.fsf@alter.siamese.dyndns.org","threadId":"32127","inReplyTo":"CAMK1S_hdsgXoPcSn__htpGCpmCsAGb9j+m+SvxtO_69eqC92gA@mail.gmail.com","subject":"Re: cloning a namespace downloads all the objects","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-11-16T16:43:13Z","receivedAt":"2012-11-16T16:43:13Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sitaram Chamarty <sitaramc@gmail.com> writes:\n\n> Hi,\n>\n> I have a repo on a server, which contains, as namespaces, the contents\n> of several different repos of varying sizes.  When I run a clone\n> command for the smallest of the namespaces (I have a script that\n> intercepts the clone and sets GIT_NAMESPACE appropriately), I get the\n> correct set of refs, but *all* the objects from *all* the namespaces.\n>\n> And since no refs from the other namespaces have come down, a 'git gc\n> --prune=now', run immediately after, reduces the size of\n> \".git/objects\" to the size I would expect for just that small\n> namespace.\n>\n> In effect, it is bringing down data that is not reachable and will be\n> wiped out on the next gc.\n>\n> Is this expected?\n\nI do not think so.\n\nThis was done with a series between a1bea2c (ref namespaces:\ninfrastructure, 2011-07-05) and bf7930c (ref namespaces: tests,\n2011-07-21); Josh, care to comment on and to look into it?\n"},{"id":"203352","messageId":"20121116173416.GA13268@sigill.intra.peff.net","threadId":"32127","inReplyTo":"7vvcd57b32.fsf@alter.siamese.dyndns.org","subject":"Re: cloning a namespace downloads all the objects","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-11-16T17:34:18Z","receivedAt":"2012-11-16T17:34:18Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Nov 16, 2012 at 08:43:13AM -0800, Junio C Hamano wrote:\n\n> > I have a repo on a server, which contains, as namespaces, the contents\n> > of several different repos of varying sizes.  When I run a clone\n> > command for the smallest of the namespaces (I have a script that\n> > intercepts the clone and sets GIT_NAMESPACE appropriately), I get the\n> > correct set of refs, but *all* the objects from *all* the namespaces.\n> >\n> > And since no refs from the other namespaces have come down, a 'git gc\n> > --prune=now', run immediately after, reduces the size of\n> > \".git/objects\" to the size I would expect for just that small\n> > namespace.\n> >\n> > In effect, it is bringing down data that is not reachable and will be\n> > wiped out on the next gc.\n> >\n> > Is this expected?\n> \n> I do not think so.\n> \n> This was done with a series between a1bea2c (ref namespaces:\n> infrastructure, 2011-07-05) and bf7930c (ref namespaces: tests,\n> 2011-07-21); Josh, care to comment on and to look into it?\n\nI'd guess that the \"create_full_pack\" logic in create_pack_file is to\nblame. The client asked for everything we advertised, so we pass \"--all\"\nto pack-objects rather than giving it the specific list of tips.\n\nWe'd have to either fix that logic, or teach the pack-objects subprocess\nto respect GIT_NAMESPACE when processing --all.\n\n-Peff\n"}]}