Skip to content

Instantly share code, notes, and snippets.

@matthew-brett
Created May 22, 2010 23:18
Show Gist options
  • Save matthew-brett/410448 to your computer and use it in GitHub Desktop.
Save matthew-brett/410448 to your computer and use it in GitHub Desktop.
# Checkin from SVN - using a local copy I had to hand
cat > authors.txt << EOF
mcc = Michael Castelle <mcc@uchicago.edu>
jdh2358 = John Hunter <jdh2358@gmail.com>
michael.castelle = Michael Castelle <mcc@uchicago.edu>
jarrod.millman = Jarrod Millman <jarrod.millman@gmail.com>
EOF
git svn clone --authors-file=authors.txt file:///home/mb312/backups/nipy-svn/ni/pbrain/trunk pbrain-svn
# commit list from git log --pretty="%h"
# 51eacd2
# dd21928
# 8febb7b
# b7bf7d6
# 2a89ca1
# 62cbee7
# 44b6e9e
cd pbrain-svn
# make branch from second commit in svn tree (first substantial commit)
git branch svn-start 62cbee7
# Checkins from (older) CVS
cd ..
git cvsimport -C pbrain-cvs -A authors.txt -v -z3 -d :pserver:anonymous@pbrain.cvs.sourceforge.net:/cvsroot/pbrain pbrain
# Add SVN as remote to CVS
cd pbrain-cvs
git remote add svn ../pbrain-svn
git fetch svn
# in CVS tree - make new branch for working
git co -b for-upload
# patch current state against first substantial checkin in SVN
git diff -R svn/svn-start > svn_start.patch
patch -p1 < svn_start.patch
git add .
git commit -a --reuse-message svn/svn-start
# switch to svn and make patch files
git co -b svn-top svn/master
git format-patch svn/svn-start
# switch back to cvs-based branch, apply patches
git co for-upload
git am 00*
# clean out working tree including patches
git clean -f
# Done, maybe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment