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

Re: git-svn very slow on fetch (shared git-svn repo)

From
EWEric Wong <normalperson@yhbt.net>
Date
Oct 11, 2009, 07:01 UTC
Message-ID
<20091011070136.GB16264@dcvr.yhbt.net>
In-Reply-To
<4AD04F95.7050603@obry.net>
Pascal Obry <pascal@obry.net> wrote:
Show 53 quoted lines
> 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
Previous: Pascal ObryNext: Pascal Obry
Message 2 of 5 in “git-svn very slow on fetch (shared git-svn repo)”
  1. Pascal ObryOct 10, 2009
  2. Eric WongOct 11, 2009
  3. Pascal ObryOct 11, 2009
  4. Eric WongOct 11, 2009
  5. Pascal ObryOct 11, 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.