# git svn: Cannot rebuild rev_map with --rewrite-root

1 messages from 2008-02-26 to 2008-02-26. Participants: Eric Kidd.
Thread: https://gitlist.dev/t/12329

## Eric Kidd, 2008-02-26 13:47

Subject: git svn: Cannot rebuild rev_map with --rewrite-root
Message-ID: <431341160802260547p5b02fa60ka124d636451cae50@mail.gmail.com>
URL: https://gitlist.dev/e/431341160802260547p5b02fa60ka124d636451cae50%40mail.gmail.com

```
Good morning! I'm trying to understand git svn's --rewrite-root
argument, and I'm confused.

In the following example, I have a Subversion repo named 'foo-svn',
containing a single (empty) project named 'foo'. This project has the
usual trunk/branches/tags layout, but no content.

When I run the following script:

  GIT_SVN_ARGS="-s --rewrite-root svn://svn.foo.org/ file://`pwd`/foo-svn/foo"

  git svn clone $GIT_SVN_ARGS foo1
  git clone foo1 foo2
  cd foo2
  git config --add remote.origin.fetch '+refs/remotes/*:refs/remotes/*'
  git fetch
  git svn init $GIT_SVN_ARGS
  git svn fetch

...it gives me the following error:

Using higher level of URL:
file:///Users/emk/src/git/git-svn-rewrite-root-test/foo-svn/foo =>
file:///Users/emk/src/git/git-svn-rewrite-root-test/foo-svn
Rebuilding .git/svn/trunk/.rev_map.6d4f8df3-8fea-4595-8e57-7b909cefc69c ...
Done rebuilding .git/svn/trunk/.rev_map.6d4f8df3-8fea-4595-8e57-7b909cefc69c
Rebuilding .git/svn/trunk/.rev_map.6d4f8df3-8fea-4595-8e57-7b909cefc69c ...
Done rebuilding .git/svn/trunk/.rev_map.6d4f8df3-8fea-4595-8e57-7b909cefc69c
Rebuilding .git/svn/trunk/.rev_map.6d4f8df3-8fea-4595-8e57-7b909cefc69c ...
Done rebuilding .git/svn/trunk/.rev_map.6d4f8df3-8fea-4595-8e57-7b909cefc69c
Rebuilding .git/svn/trunk/.rev_map.6d4f8df3-8fea-4595-8e57-7b909cefc69c ...
Done rebuilding .git/svn/trunk/.rev_map.6d4f8df3-8fea-4595-8e57-7b909cefc69c
Last fetched revision of refs/remotes/trunk was r2, but we are about
to fetch: r2!

You can find the Subversion repository and the script here:

  http://www.randomhacks.net/tmp/git-svn-rewrite-root-test.tar.gz

Other things I've tried:

 1) If I remove --rewrite-root from GIT_SVN_ARGS, it works fine.
 2) If I omit the 'git config --add remote.origin.fetch' step, it works fine.
 3) If I add more revisions to foo/trunk, I get an error of the form:

Last fetched revision of refs/remotes/trunk was $LAST_REV, but we are
about to fetch: $FIRST_REV!

 4) The following versions of git-svn all behave the same way:

    git-svn HEAD on MacOS X 10.5
    git-svn 1.5.3.7 on MacOS X 10.5
    git-svn 1.5.4 on Cygwin

 5) If I access the Subversion repository using svn+ssh://..., I get
the same error.

If I run 'git svn --version', I get:

    git-svn version 1.5.4.3.220.g99d8e (svn 1.4.4)

Also, a possibly related error was mentioned here by a user upgrading
from 1.5.3.4.452.g09149 to 1.5.4.1:

http://thread.gmane.org/gmane.comp.version-control.git/73661/focus=73664

So, am I abusing --rewrite-root, and suffering a well-deserved
failure? Or is this unexpected behavior?

Thank you for any advice you can provide!

Cheers,
Eric

```
