Getting a list of authors
First thing was to get a list of users who have committed to SVN. We need this to create an authors file mapping the SVN users to Git users.
$ svn log --quiet https://pegasus.isi.edu/svn/pegasus | grep "^r" | cut -d'|' -f2 | sort | uniq
After a few minutes it gives a list. After that, I tracked down all those people and created a file that looks like this:
akumar = Atul Kumar <firstname.lastname@example.org>
byun = Eun-kyu Byun <email@example.com>
cgsmd1 = Gaurang Mehta <firstname.lastname@example.org>
cward = Craig Ward <email@example.com>
dang = Daniel Gunter <firstname.lastname@example.org>
dkgunter = Daniel Gunter <email@example.com>
fabio = Fabio Silva <firstname.lastname@example.org>
gideon = Gideon Juve <email@example.com>
gmehta = Gaurang Mehta <firstname.lastname@example.org>
ksb = Keith Beattie <KSBeattie@lbl.gov>
mayani = Rajiv Mayani <email@example.com>
prasanth = Prasanth Thomas <firstname.lastname@example.org>
rubing = Rubing Duan <email@example.com>
rynge = Mats Rynge <firstname.lastname@example.org>
smithd = David Smith <email@example.com>
vahi = Karan Vahi <firstname.lastname@example.org>
voeckler = Jens Vöckler <email@example.com>
wchen = Weiwei Chen <firstname.lastname@example.org>
wmullins = Bill Mullins <email@example.com>
(no author) = Pegasus <firstname.lastname@example.org>
Notice that "(no author)" is mapped to Pegasus. That is a result of the original CVS-SVN conversion, which lost some authorship info.
I saved the list in a file called /tmp/authors.txt
Converting from Subversion to Git
For this step I used a tool called svn2git, which is a wrapper around "git svn" that automates some of the stuff about creating branches.
It all boils down to something like this:
$ sudo gem install svn2git
$ mkdir pegasus
$ cd pegasus
$ svn2git --verbose --authors /tmp/authors.txt https://pegasus.isi.edu/svn/pegasus
svn2git leaves a bunch of cruft in the repository. I just cleaned that stuff manually.
First I had to remove some of the branches:
$ git branch -D monitord@3333
$ git branch -D bill-doc@3339
$ git branch -D pmc_io@5545
$ git branch -a | grep remotes/svn | sed 's,remotes/,,' | xargs git branch -d -r
rm -rf .git/svn .git/refs/remotes/svn
Creating .gitignore files
Unfortunately, we need to create a bunch of .gitignore files to ignore all of the files that were ignored by svn:ignore properties in Subversion.
First, I got a list of the entries from my svn repository and saved them to a file:
$ cd SVN_REPO
$ svn propget svn:ignore -R > ignores
$ cd GIT_REPO
$ svn2git-ignore SVN_REPO/ignores
$ git add .
$ git commit -m "Add .gitignore files"
Pushing to GitHub
Finally, I pushed everything to my GitHub repository, which I created on GitHub.com:
$ git remote add origin email@example.com:pegasus-isi/pegasus.git
$ git push origin --all
$ git push origin --tags