git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cloning a namespace downloads all the objects
@ 2012-11-16 16:34 Sitaram Chamarty
  2012-11-16 16:43 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Sitaram Chamarty @ 2012-11-16 16:34 UTC (permalink / raw)
  To: Git Mailing List

Hi,

I have a repo on a server, which contains, as namespaces, the contents
of several different repos of varying sizes.  When I run a clone
command for the smallest of the namespaces (I have a script that
intercepts the clone and sets GIT_NAMESPACE appropriately), I get the
correct set of refs, but *all* the objects from *all* the namespaces.

And since no refs from the other namespaces have come down, a 'git gc
--prune=now', run immediately after, reduces the size of
".git/objects" to the size I would expect for just that small
namespace.

In effect, it is bringing down data that is not reachable and will be
wiped out on the next gc.

Is this expected?

-- 
Sitaram

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: cloning a namespace downloads all the objects
  2012-11-16 16:34 cloning a namespace downloads all the objects Sitaram Chamarty
@ 2012-11-16 16:43 ` Junio C Hamano
  2012-11-16 17:34   ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2012-11-16 16:43 UTC (permalink / raw)
  To: Josh Triplett; +Cc: Git Mailing List, Sitaram Chamarty

Sitaram Chamarty <sitaramc@gmail.com> writes:

> Hi,
>
> I have a repo on a server, which contains, as namespaces, the contents
> of several different repos of varying sizes.  When I run a clone
> command for the smallest of the namespaces (I have a script that
> intercepts the clone and sets GIT_NAMESPACE appropriately), I get the
> correct set of refs, but *all* the objects from *all* the namespaces.
>
> And since no refs from the other namespaces have come down, a 'git gc
> --prune=now', run immediately after, reduces the size of
> ".git/objects" to the size I would expect for just that small
> namespace.
>
> In effect, it is bringing down data that is not reachable and will be
> wiped out on the next gc.
>
> Is this expected?

I do not think so.

This was done with a series between a1bea2c (ref namespaces:
infrastructure, 2011-07-05) and bf7930c (ref namespaces: tests,
2011-07-21); Josh, care to comment on and to look into it?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: cloning a namespace downloads all the objects
  2012-11-16 16:43 ` Junio C Hamano
@ 2012-11-16 17:34   ` Jeff King
  0 siblings, 0 replies; 3+ messages in thread
From: Jeff King @ 2012-11-16 17:34 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Josh Triplett, Git Mailing List, Sitaram Chamarty

On Fri, Nov 16, 2012 at 08:43:13AM -0800, Junio C Hamano wrote:

> > I have a repo on a server, which contains, as namespaces, the contents
> > of several different repos of varying sizes.  When I run a clone
> > command for the smallest of the namespaces (I have a script that
> > intercepts the clone and sets GIT_NAMESPACE appropriately), I get the
> > correct set of refs, but *all* the objects from *all* the namespaces.
> >
> > And since no refs from the other namespaces have come down, a 'git gc
> > --prune=now', run immediately after, reduces the size of
> > ".git/objects" to the size I would expect for just that small
> > namespace.
> >
> > In effect, it is bringing down data that is not reachable and will be
> > wiped out on the next gc.
> >
> > Is this expected?
> 
> I do not think so.
> 
> This was done with a series between a1bea2c (ref namespaces:
> infrastructure, 2011-07-05) and bf7930c (ref namespaces: tests,
> 2011-07-21); Josh, care to comment on and to look into it?

I'd guess that the "create_full_pack" logic in create_pack_file is to
blame. The client asked for everything we advertised, so we pass "--all"
to pack-objects rather than giving it the specific list of tips.

We'd have to either fix that logic, or teach the pack-objects subprocess
to respect GIT_NAMESPACE when processing --all.

-Peff

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-16 17:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-16 16:34 cloning a namespace downloads all the objects Sitaram Chamarty
2012-11-16 16:43 ` Junio C Hamano
2012-11-16 17:34   ` Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).