Skip to content
Browse files

Add svn to git conversion scripts

  • Loading branch information...
1 parent f2b351c commit 72f96e18423e07942b36d2669d427299848e4ced @chrisridd committed Nov 30, 2012
Showing with 116 additions and 0 deletions.
  1. +27 −0 conversion/README.md
  2. +17 −0 conversion/convert
  3. +9 −0 conversion/idmap.forgerock
  4. +1 −0 conversion/idmap.oracle
  5. +37 −0 conversion/idmap.sun
  6. +25 −0 conversion/rules
View
27 conversion/README.md
@@ -0,0 +1,27 @@
+Convert from svn to git
+=======================
+
+Currently the OpenDJ repository is held in subversion. This is a set of scripts
+using the svn-all-fast-export tool from KDE that convert it (one-way) to a
+nice clean git repository.
+
+I originally discovered this tool [here](http://blog.smartbear.com/software-quality/bid/170525/Migrating-from-Subversion-to-Git-Lessons-Learned)
+after struggling with git-svn.
+
+That tool is pretty difficult to build if you don't have exactly the right
+versions of KDE/Qt/etc, so for simplicity I run this in Ubuntu 12. The
+converted repo obviously doesn't require Linux.
+
+The first thing you want is a local copy of the whole SVN repo. I put this in
+opendj-svn. This has all the branches, tags, everything.
+
+Then just run the `convert` script. It takes a few minutes, and uses the rules
+in `rules` to get around various oddities in the svn repo. This is quite amazing
+because git-svn takes about 10 hours to do the same conversion!
+
+The main difficulty in the conversion is handled by running the tool in several
+steps. It does this because the committer names used by svn should be converted
+into "correct" email addresses for git, and over time the same committer names
+have worked for Sun, Oracle, and ForgeRock. I set up 3 `idmap.*` files to cover
+these three periods of time. I don't think the boundaries between all three
+periods is completely correct. Corrections are welcomed!
View
17 conversion/convert
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Convert the opendj repository from subversion to git
+
+tool=svn-all-fast-export
+repo=opendj-svn
+
+rm -fr opendj
+
+# Ranges of commits need different identity-maps.
+# This shows one way to achieve this.
+
+# From start committers are from sun.com
+$tool --rules rules --max-rev 6616 --identity-map idmap.sun $repo
+# Around r???? committers are from oracle.com
+#$tool --rules rules --max-rev 6616 --identity-map idmap.oracle $repo
+# Around r6617 committers are from forgerock.com
+$tool --rules rules --resume-from 6617 --identity-map idmap.forgerock $repo
View
9 conversion/idmap.forgerock
@@ -0,0 +1,9 @@
+mark = Mark Craig <mark.craig@forgerock.com>
+ludo = Ludovic Poitou <ludovic.poitou@forgerock.com>
+gary.williams = Gary Williams <gary.williams@forgerock.com>
+cjr = Chris Ridd <chris.ridd@forgerock.com>
+matthew = Matthew Swift <matthew.swift@forgerock.com>
+miroslavfadrhonc = Miroslav Fadrhonc <miroslav.fadrhonc@forgerock.com>
+n4al = Nemanja Lukić <nemanja.lukic@profiq.cz>
+cgp = German Parente <cgerman.parente@gmail.com>
+violette = Violette Roche-Montane <violette.roche-montane@forgerock.com>
View
1 conversion/idmap.oracle
@@ -0,0 +1 @@
+mmarie = Mathieu Marie <mathieu.marie@oracle.com>
View
37 conversion/idmap.sun
@@ -0,0 +1,37 @@
+neil_a_wilson = Neil A. Wilson <Neil.A.Wilson@Sun.COM>
+el_kaboing = Mike Keyes <Michael.Keyes@Sun.COM>
+gbellato = Gilles Bellaton <Gilles.Bellaton@Sun.COM>
+coulbeck = Andy Coulbeck <Andrew.Coulbeck@sun.com>
+matthew_swift = Matthew Swift <Matthew.Swift@Sun.COM>
+behret = Brian Ehret <Brian.Ehret@Sun.COM>
+al_xipe = Arnaud Lacour <Arnaud.Lacour@Sun.COM>
+boli = Bo Li <b.li@Sun.COM>
+dugan = Mike Dugan <Michael.Dugan@Sun.COM>
+davidely = David Ely <David.Ely@Sun.COM>
+lutoff = Daniel Lutoff <Daniel.Lutoff@Sun.COM>
+gary_williams = Gary Williams <Williams.Gary@Sun.COM>
+tdj_tx = Tom Jones <Tom.Jones@Sun.COM>
+jvergara = Josu Vergara <Josu.Vergara@Sun.COM>
+treydrake = Trey Drake <trey.drake@sun.com>
+pgamba = Philippe GAMBA <Philippe.Gamba@Sun.COM>
+sin = Kunal Sinha <Kunal.Sinha@Sun.COM>
+david_page = David Scott Page <David.Page@Sun.COM>
+abobrov = Anton Bobrov <Anton.Bobrov@Sun.COM>
+kenneth_suter = Kenneth Suter <Kenneth.Suter@Sun.COM>
+jdemendi = Joseph de Menditte <Joseph.De-Menditte@Sun.COM>
+ugaston = Unai Gaston Caminos <Unai.Gaston@Sun.COM>
+mkeyes = Mike Keyes <Michael.Keyes@Sun.COM>
+smaguin = Sylvie Maguin <Sylvie.Maguin@Sun.COM>
+shankar_mbn = Shankar Gowda <Shankar.Gowda@Sun.COM>
+sgouvern = Sylvie Gouverneyre-Chambert <Sylvie.Gouverneyre@Sun.COM>
+schwing = Jean-Luc Schwing <Jean-Luc.Schwing@Sun.COM>
+sberthol = Sebastien Bertholet <Sebastien.Bertholet@Sun.COM>
+rhaggard = Ragan Haggard <Ragan.Haggard@Sun.COM>
+ooudghir = Olivier Oudghiri <Olivier.Oudghiri@Sun.COM>
+mrossign = Mathieu Rossignol <Mathieu.Rossignol@Sun.COM>
+maudj = Maud Jamati-Bartlett <Maud.Jamati@Sun.COM>
+madiot = Pierre-Ephrem Madiot <Pierre.Madiot@Sun.COM>
+sshoaff = Stephen Shoaff <sshoaff@sun.com>
+jpikus = Jeanine Pikus <Jeanine.Pikus@Sun.COM>
+jcduff = Christopher Duff <Christopher.Duff@Sun.COM>
+ludovicp = Ludovic Poitou <Ludovic.Poitou@Sun.COM>
View
25 conversion/rules
@@ -0,0 +1,25 @@
+create repository opendj
+end repository
+
+match /branches/README
+end match
+
+match /tags/README
+end match
+
+match /README
+end match
+
+match /trunk/
+ repository opendj
+ branch master
+end match
+
+match /branches/([^/]+)/
+ repository opendj
+ branch \1
+end match
+
+match /tags/([^/]+)/
+ action ignore
+end match

0 comments on commit 72f96e1

Please sign in to comment.
Something went wrong with that request. Please try again.