[Zope-dev] Git conversion with svn-all-fast-export

Marius Gedminas marius at gedmin.as
Tue Feb 5 15:36:38 UTC 2013


Some minor updates:

On Mon, Feb 04, 2013 at 09:59:37PM +0200, Marius Gedminas wrote:
> The conversion process goes like this:
> 
> - write a rules.txt like this one I used for zope.dottedname:
> 
>     create repository zope.dottedname
>     end repository
> 
>     # feel free to create multiple repositories in one go
> 
>     # order of matches matters in this file
>     # trailing slashes in match rules are very important

>     match /
>       # skip revisions 129030, 129031 and 129032, since they're empty
>       # in my svn mirror (no files, no committer, no date) for some reason
>       # (bug in svnsync?), and they make svn-all-fast-export segfault
>       min revision 129030
>       max revision 129032
>     end match

This bit doesn't work (I still get the segfault).  What works is
re-running the conversion script so it picks up the pieces.

The three missing commits are test commits in /2github, so can be safely
ignored.  Besides, I doubt your Zope mirror will have the same defect.


A more interesting thing to add to the rules is this bit:

      match /Zope3/trunk/src/zope/dottedname/
        repository zope.dottedname
        branch monolithic-zope3
      end match

This way you can 'git blame' and see where the code actually originated.
Just be sure not to use "branch master" here, or you'll get a big mess.

For packages created before the namegeddon you might need more rules.
http://zope3.pov.lt/trac/log/zope.dottedname is useful for finding the old
location of code (click on r75116 aka "Moving code to satellite" to see).

>     match /(zope\.dottedname)/trunk/
>       repository \1
>       branch master
>     end match
> 
>     match /(zope\.dottedname)/branches/([^/]+)/
>       repository \1
>       branch \2
>     end match
> 
>     match /(zope\.dottedname)/tags/([^/]+)/
>       repository \1
>       branch refs/tags/\2
>     end match
> 
>     match /
>       # ignore all other projects
>     end match
> 
> - run svn-all-fast-export --identity-map=authors.txt --rules=rules.txt --stats \
>       /path/to/your/zope-svn-mirror
> 
> - wait a bit
> 
>     The first time I ran it it took ~18 wall clock minutes 

On my laptop (faster Core i5 CPU, SSD) it takes less than 4 wall clock
minutes.

> - inspect ./zope.dottedname for sanity
> 
>     I recommend tig as a very nice console-mode interactive git history viewer.

'gitk --all' also works very well.

>     For an example of things to inspect, e.g., there was a deleted 3.4.1 tag
>     from http://zope3.pov.lt/trac/changeset/80495, which shouldn't have been
>     deleted, according to http://zope3.pov.lt/trac/changeset/80499, so I've
>     re-created the tag from refs/backups/r80495/tags/3.4.1 that was left by
>     the conversion tool.

This bit was 'git tag 3.4.1 refs/backups/r80495/tags/3.4.1'

> - upload to github

This bit is

    git remote add origin git at github.com:zopefoundation/zope.dottedname.git
    git push -u origin --all
    git push origin --tags


One more step at the end:

 - Remove old code from subversion, once you're sure the conversion is
   fine:

     svn rm *
     echo 'See https://github.com/zopefoundation/zope.dottedname' > MOVED_TO_GITHUB
     svn add MOVED_TO_GITHUB
     svn ci -m "Moved to github"


Next I was going to add Travis CI integration, but, apparently, I need
to be an admin of the ZopeFoundation organization to set up the needed
hooks.  Hint, hint.


Marius Gedminas
-- 
http://pov.lt/ -- Zope 3/BlueBream consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: Digital signature
URL: <http://mail.zope.org/pipermail/zope-dev/attachments/20130205/97c89e93/attachment.sig>


More information about the Zope-Dev mailing list