threads / discuss / 8325

Problems importing SVN repo via git-svnimport

Subject: Problems importing SVN repo via git-svnimport

## tl;dr

4 messages between May 26, 2007 and May 26, 2007.

replies: 3people: 2as markdown or json

Art Haas· May 26, 2007, 12:55 UTC · lore
Hi.

I'm attempting to convert the Subversion repo of my project PythonCAD (shameless plug http://www.pythoncad.org) into git, and have not had much luck so far. Yesterday I installed an up-to-date set of SVN::Perl modules and began trying to do the import.

On my local machine the repo is file:///mnt/src/svnrepo, and the structure inside is 'pythoncad/trunk', 'pythoncad/branches', and 'pythoncad/tags'. For those playing at home, you can access the public repo via http://subversion.pythoncad.org:9000/svn and you should see the same layout. Way back when I started, though, the initial directory was called 'pycad', and it lasted up through revision 113, when in revision 114 it became 'pythoncad'. The next eight or nine revisions involve me moving files around into the new directory path. I don't remember exactly why I did the rename right now (it's more than four years ago) but I think it was because I found other 'pycad' projects/companies on the internet.

So, with 'git-svnimport' I've tried a number of different commands to pull my data into git, and have only succeeded in getting a log history into git but none of the actual file data makes it in. In my newly built git repo I can do 'git log' and read all the checkin comments that I made using 'svn commit'; git imports this data without problem. My actual files, however, never appear. I poked around the git-svnimport code a bit, added a few print statements here and there, and found that the commit subroutine is failing. Specifically, during the loop where the actions listed in the log output are scanned (around line 690), the tests to determine the node_kind are always returning $SVN::Node::none, not $SVN::Node::file or $SVN::Node::dir, so my tree never gets populated with files and directories.

I tried importing only the first 114 revisions (the 'pycad' set) with the following command:

$ git svnimport -C /tmp/pycad.git -l 114 -A authors -T pycad/trunk \ -b pycad/branches -t pycad/tags -v file:///mnt/src/svnrepo /pycad

I've also tried starting at rev 114 and going to the end (the 'pythoncad' set) but the end result is a git repo with a log file but no file content.

I'm happy to dive into the perl code in svnimport and make changes to help debug this problem, if there is actually a problem and not user error on my part. Any help from 'svnimport' experts will be greatly appreciated. The public repo listed above has the same contents as my local repo, so feel free to poke around it to see how things are structured.

Thanks in advance.
Art Haas
-- 
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822
Frank Lichtenheld· May 26, 2007, 13:06 UTC · re: Art Haas · lore

Re: Problems importing SVN repo via git-svnimport

On Sat, May 26, 2007 at 07:55:53AM -0500, Art Haas wrote:
Show 6 quoted lines
> I'm happy to dive into the perl code in svnimport and make changes to
> help debug this problem, if there is actually a problem and not user
> error on my part. Any help from 'svnimport' experts will be greatly
> appreciated. The public repo listed above has the same contents as my
> local repo, so feel free to poke around it to see how things are
> structured.

You might want to try git-svn instead. It should support everything you can do with git-svnimport and much more. Plus it is actively maintained which I wouldn't say about git-svnimport.

Gruesse,
-- 
Frank Lichtenheld <frank@lichtenheld.de>
www: http://www.djpig.de/
Art Haas· May 26, 2007, 15:10 UTC · re: Frank Lichtenheld · lore

Re: Problems importing SVN repo via git-svnimport

On Sat, May 26, 2007 at 03:06:43PM +0200, Frank Lichtenheld wrote:
Show 11 quoted lines
> On Sat, May 26, 2007 at 07:55:53AM -0500, Art Haas wrote:
> > I'm happy to dive into the perl code in svnimport and make changes to
> > help debug this problem, if there is actually a problem and not user
> > error on my part. Any help from 'svnimport' experts will be greatly
> > appreciated. The public repo listed above has the same contents as my
> > local repo, so feel free to poke around it to see how things are
> > structured.
> 
> You might want to try git-svn instead. It should support everything you
> can do with git-svnimport and much more. Plus it is actively maintained
> which I wouldn't say about git-svnimport.
Hi.

The git-svn docs say that it serves as a bi-directionaly gateway between git and svn, but that the main repo is a Subversion repository. My goal with the PythonCAD repo is to convert it so that the main repository is in git, and then I'm going to try to use git-svn to push my changes into the now-secondary Subversion repo. This way, I can make a distributed git repo available to developers wanting to contribute to PythonCAD, plus keep the developers currently using Subversion from having to make any changes if they either don't want to or are unable to (i.e. windows developers/users).

Is git-svnimport maintenence on the wane?
Art Haas

Offtopic P.S.: Anyone know of a git mirror of the GCC repo, or do people use git-svn to access that code via git?

-- 
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822
Frank Lichtenheld· May 26, 2007, 15:34 UTC · re: Art Haas · lore

Re: Problems importing SVN repo via git-svnimport

On Sat, May 26, 2007 at 10:10:46AM -0500, Art Haas wrote:
Show 16 quoted lines
> On Sat, May 26, 2007 at 03:06:43PM +0200, Frank Lichtenheld wrote:
> > On Sat, May 26, 2007 at 07:55:53AM -0500, Art Haas wrote:
> > > I'm happy to dive into the perl code in svnimport and make changes to
> > > help debug this problem, if there is actually a problem and not user
> > > error on my part. Any help from 'svnimport' experts will be greatly
> > > appreciated. The public repo listed above has the same contents as my
> > > local repo, so feel free to poke around it to see how things are
> > > structured.
> > 
> > You might want to try git-svn instead. It should support everything you
> > can do with git-svnimport and much more. Plus it is actively maintained
> > which I wouldn't say about git-svnimport.
> 
> Hi.
> 
> The git-svn docs say that it serves as a bi-directionaly gateway

It can be happily used for one-time imports, too. You might want to use some options like the authors file and perhaps --no-metadata. Can't say much about the rest of your plans since I'm no git-svn expert. I have only ever used it for one-time imports so far.

Show 10 quoted lines
> between git and svn, but that the main repo is a Subversion repository.
> My goal with the PythonCAD repo is to convert it so that the main
> repository is in git, and then I'm going to try to use git-svn to
> push my changes into the now-secondary Subversion repo. This way, I can
> make a distributed git repo available to developers wanting to
> contribute to PythonCAD, plus keep the developers currently using
> Subversion from having to make any changes if they either don't want to
> or are unable to (i.e. windows developers/users).
> 
> Is git-svnimport maintenence on the wane?

Search the archive of the last month for posts on git-svnimport... IIRC there was one typo fix and one thread about a problem with it that ended in the question wether it should be removed.

Gruesse,
-- 
Frank Lichtenheld <frank@lichtenheld.de>
www: http://www.djpig.de/

← back to recent threads