Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is git-svn is randomly changing my root directory to the parent? [duplicate]

Tags:

git

svn

git-svn

I'm trying to git-svn to work on a private shadowcat svn server.

git svn clone -s http://dev.catalystframework.org/repos/Catalyst/Catalyst-Plugin-ConfigLoader/
Initialized empty Git repository in /home/ecarroll/code/perl/foo/Catalyst-Plugin-ConfigLoader/.git/
Using higher level of URL: http://dev.catalystframework.org/repos/Catalyst/Catalyst-Plugin-ConfigLoader => http://dev.catalystframework.org/repos/Catalyst

What doesn't that work? It looks like http://dev.catalystframework.org/repos/Catalyst/Catalyst-Plugin-ConfigLoader/ has the standard layout.

Is there a sane simple way to get git to pull from an svn repo?

like image 771
NO WAR WITH RUSSIA Avatar asked Sep 20 '10 23:09

NO WAR WITH RUSSIA


1 Answers

I'm a little late in answering now that the Catalyst-Plugin-ConfigLoader project has migrated to Git, but I'll answer in case someone runs into a similar problem with a different svn project.

git svn tries to be helpful by searching for the root of the svn repository and using that instead of the URL you give it. I find it annoying, but fortunately there's a workaround: use the --no-minimize-url option.

From the git svn documentation (git help svn):

--no-minimize-url

When tracking multiple directories (using --stdlayout, --branches, or --tags options), git svn will attempt to connect to the root (or highest allowed level) of the Subversion repository. This default allows better tracking of history if entire projects are moved within a repository, but may cause issues on repositories where read access restrictions are in place. Passing --no-minimize-url will allow git svn to accept URLs as-is without attempting to connect to a higher level directory. This option is off by default when only one URL/branch is tracked (it would do little good).

like image 83
Richard Hansen Avatar answered Oct 19 '22 15:10

Richard Hansen