[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Converting a proprietary svn repository to git

From: Vadim Zeitlin
Subject: Re: [lmi] Converting a proprietary svn repository to git
Date: Fri, 26 Feb 2016 03:01:13 +0100

On Fri, 26 Feb 2016 00:17:43 +0000 Greg Chicares <address@hidden> wrote:

GC> Vadim--do you see any real reason not to use 'git svn' in this case,
GC> particularly with '--no-metadata'?

 In the simple case "git svn clone" works just fine. Things get more
complicated if you want to convert the existing branches and tags or want
to make some changes to the repository structure. I wrote a guide about
this some time ago if you're curious:


but from your description it doesn't seem like you need any of this here.

GC> I've used a sequence of commands [0] that does seem to work. However,
GC> there's less than universal agreement that this is the best way:
GC>   http://esr.ibiblio.org/?p=6778
GC>   Don’t do svn-to-git repository conversions with git-svn!

 Well, ESR wrote reposurgeon which does, among other things, repository
conversions, so I guess he had reasons to do it, but I did quite a few
(several dozens?) of svn-to-git migrations myself and I never encountered
the problems he mentions, so they must not be as common as that.

GC> Anyway, I was searching for any reason not to use '--no-metadata'
GC> when I found that you contributed to its documentation:
GC>   http://comments.gmane.org/gmane.comp.version-control.git/154150

 It wasn't clear to me back at the time that without --no-metadata there
was no way to update the git mirror from svn, so this was why I asked. If
you don't plan to ever update the svn repository again, this is not a

GC> [0] "sequence of commands":
GC> /home/greg/tainted/migration/svn_working_copy/repository[0]$svn log --xml \
GC>   | grep author | sort -u \
GC>   | sed -e "s/^[^>]*>\([^<]*\)<[^<]*$/\1 = \1 <address@hidden>/" \
GC>   >../../authors.txt

 This is a nice one-liner, I didn't think to do it like this (probably
because of my instinctive aversion to XML) and used a separate script

GC> # convert svn to git
GC> /home/greg/tainted/migration/svn_working_copy/repository[0]$cd ../..
GC> /home/greg/tainted/migration[0]$git svn clone \
GC>   file:///home/greg/tainted/migration/repository \
GC>   --authors-file=authors.txt --no-metadata --trunk=/ ./proprietary

 I guess your svn repository uses non-standard layout, which is why --trunk
option is needed. But other than this, this is perfectly fine.

 The next step would be to "git push --all" to some bare repository and
then clone it from somewhere else and verify that everything looks good.

 Good luck,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]