git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-svn very slow on fetch (shared git-svn repo)
@ 2009-10-10  9:10 Pascal Obry
  2009-10-11  7:01 ` Eric Wong
  0 siblings, 1 reply; 5+ messages in thread
From: Pascal Obry @ 2009-10-10  9:10 UTC (permalink / raw)
  To: git list


Here is the problem.

Doing a:

    $ git svn fetch

Takes age to update the repository. The long story is that I'm trying to 
have shared git-svn repositories.

I'm cloning the repository on a server using a standard "git svn clone". 
I then let users cloning this repository using the procedure described 
in git-svn help. Copy/paste here:

<<
        # Do the initial import on a server
                ssh server "cd /pub && git svn clone 
http://svn.example.com/project
        # Clone locally - make sure the refs/remotes/ space matches the 
server
                mkdir project
                cd project
                git init
                git remote add origin server:/pub/project
                git config --add remote.origin.fetch 
'+refs/remotes/*:refs/remotes/*'
                git fetch
        # Create a local branch from one of the branches just fetched
                git checkout -b master FETCH_HEAD
        # Initialize 'git svn' locally (be sure to use the same URL and 
-T/-b/-t options as were used on server)
                git svn init http://svn.example.com/project
        # Pull the latest changes from Subversion
                git svn rebase
 >>

If you do a "git svn fetch" (to get new branches) it takes age if you 
have imported branches that are not used since a long time.

I've traced this down to the Perl fetch_all procedure. It seems that the 
fetch is looking at the older version in all branches and then read the 
remote repository starting from this revision. As some branches are 
unused since a very long it it re-read most of the history. In my 
example it start at rev 8200 whereas the last revision on trunk is 
150000 (I put trace in git-svn Perl script).

I have observed that this happen only the first time.

This can be confirmed by the fact that if you break git-svn fetch 
process and restart it it will start to a later revision. So it seems 
that git-svn is keeping some kind of data about what has already been 
fetched but those data are not properly copied by the procedure above.

Is there a workaround that? Where are those data stored?

Any guidance would be very welcomed.

Thanks,
Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|    http://www.obry.net  -  http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B

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

* Re: git-svn very slow on fetch (shared git-svn repo)
  2009-10-10  9:10 git-svn very slow on fetch (shared git-svn repo) Pascal Obry
@ 2009-10-11  7:01 ` Eric Wong
  2009-10-11  9:00   ` Pascal Obry
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Wong @ 2009-10-11  7:01 UTC (permalink / raw)
  To: Pascal Obry; +Cc: git list

Pascal Obry <pascal@obry.net> wrote:
> Here is the problem.
>
> Doing a:
>
>    $ git svn fetch
>
> Takes age to update the repository. The long story is that I'm trying to  
> have shared git-svn repositories.
>
> I'm cloning the repository on a server using a standard "git svn clone".  
> I then let users cloning this repository using the procedure described  
> in git-svn help. Copy/paste here:
>
> <<
>        # Do the initial import on a server
>                ssh server "cd /pub && git svn clone  
> http://svn.example.com/project
>        # Clone locally - make sure the refs/remotes/ space matches the  
> server
>                mkdir project
>                cd project
>                git init
>                git remote add origin server:/pub/project
>                git config --add remote.origin.fetch  
> '+refs/remotes/*:refs/remotes/*'
>                git fetch
>        # Create a local branch from one of the branches just fetched
>                git checkout -b master FETCH_HEAD
>        # Initialize 'git svn' locally (be sure to use the same URL and  
> -T/-b/-t options as were used on server)
>                git svn init http://svn.example.com/project
>        # Pull the latest changes from Subversion
>                git svn rebase
> >>
>
> If you do a "git svn fetch" (to get new branches) it takes age if you  
> have imported branches that are not used since a long time.
>
> I've traced this down to the Perl fetch_all procedure. It seems that the  
> fetch is looking at the older version in all branches and then read the  
> remote repository starting from this revision. As some branches are  
> unused since a very long it it re-read most of the history. In my  
> example it start at rev 8200 whereas the last revision on trunk is  
> 150000 (I put trace in git-svn Perl script).
>
> I have observed that this happen only the first time.
>
> This can be confirmed by the fact that if you break git-svn fetch  
> process and restart it it will start to a later revision. So it seems  
> that git-svn is keeping some kind of data about what has already been  
> fetched but those data are not properly copied by the procedure above.
>
> Is there a workaround that? Where are those data stored?

Hi Pascal,

For globs (branches and tags) the $GIT_DIR/svn/.metadata
config file, under the svn-remote.svn.{branches,tags}-maxRev keys.

For explicitly specified refs (e.g. "trunk"), then it's in the last
record of the corresponding rev_map (e.g.
$GIT_DIR/svn/trunk/.rev_map.$UUID) as a 4-byte revision number + 20
bytes of zeroes.

-- 
Eric Wong

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

* Re: git-svn very slow on fetch (shared git-svn repo)
  2009-10-11  7:01 ` Eric Wong
@ 2009-10-11  9:00   ` Pascal Obry
  2009-10-11  9:03     ` Eric Wong
  0 siblings, 1 reply; 5+ messages in thread
From: Pascal Obry @ 2009-10-11  9:00 UTC (permalink / raw)
  To: Eric Wong; +Cc: git list

Hi Eric,

> For globs (branches and tags) the $GIT_DIR/svn/.metadata
> config file, under the svn-remote.svn.{branches,tags}-maxRev keys.

Right. I found out that copying the .metadata solve this problem.

> For explicitly specified refs (e.g. "trunk"), then it's in the last
> record of the corresponding rev_map (e.g.
> $GIT_DIR/svn/trunk/.rev_map.$UUID) as a 4-byte revision number + 20
> bytes of zeroes.

Seems like we do not need to copy this one as it is reconstructed by a 
simple rebase on the trunk branch. This is quite fast as reconstructed 
from the embedded git-svn-id if I'm not mistaken.

So you confirm that copying the .metadata is the solution?

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|    http://www.obry.net  -  http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B

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

* Re: git-svn very slow on fetch (shared git-svn repo)
  2009-10-11  9:00   ` Pascal Obry
@ 2009-10-11  9:03     ` Eric Wong
  2009-10-11  9:37       ` Pascal Obry
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Wong @ 2009-10-11  9:03 UTC (permalink / raw)
  To: Pascal Obry; +Cc: git list

Pascal Obry <pascal@obry.net> wrote:
> Hi Eric,
>
>> For globs (branches and tags) the $GIT_DIR/svn/.metadata
>> config file, under the svn-remote.svn.{branches,tags}-maxRev keys.
>
> Right. I found out that copying the .metadata solve this problem.
>
>> For explicitly specified refs (e.g. "trunk"), then it's in the last
>> record of the corresponding rev_map (e.g.
>> $GIT_DIR/svn/trunk/.rev_map.$UUID) as a 4-byte revision number + 20
>> bytes of zeroes.
>
> Seems like we do not need to copy this one as it is reconstructed by a  
> simple rebase on the trunk branch. This is quite fast as reconstructed  
> from the embedded git-svn-id if I'm not mistaken.
>
> So you confirm that copying the .metadata is the solution?

Yes, copying .metadata should be enough.  The .rev_map rebuild should
be fast.

-- 
Eric Wong

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

* Re: git-svn very slow on fetch (shared git-svn repo)
  2009-10-11  9:03     ` Eric Wong
@ 2009-10-11  9:37       ` Pascal Obry
  0 siblings, 0 replies; 5+ messages in thread
From: Pascal Obry @ 2009-10-11  9:37 UTC (permalink / raw)
  To: Eric Wong; +Cc: git list

Eric,

> Yes, copying .metadata should be enough.

I've put this in place. Works fine.

 > The .rev_map rebuild should be fast.

Yep. Thanks for your quick reply.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|    http://www.obry.net  -  http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B

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

end of thread, other threads:[~2009-10-11  9:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-10  9:10 git-svn very slow on fetch (shared git-svn repo) Pascal Obry
2009-10-11  7:01 ` Eric Wong
2009-10-11  9:00   ` Pascal Obry
2009-10-11  9:03     ` Eric Wong
2009-10-11  9:37       ` Pascal Obry

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).