Skip to content

Instantly share code, notes, and snippets.

@wmanley
Created February 25, 2014 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wmanley/9213023 to your computer and use it in GitHub Desktop.
Save wmanley/9213023 to your computer and use it in GitHub Desktop.
Script used to create git mirror of [tesseract SVN from googlecode](https://code.google.com/p/tesseract-ocr/) with history from [tesseract CVS from sourceforge](http://sourceforge.net/projects/tesseract-ocr/) included.
#!/bin/sh
git svn clone -s --prefix=googlecode/ http://tesseract-ocr.googlecode.com/svn tesseract-svn
rsync -av tesseract-ocr.cvs.sourceforge.net::cvsroot/tesseract-ocr/tesseract/ cvs-clone/
git init tesseract-cvs --bare
(cd cvs-clone && find . -name '*,v' -print | cvs-fast-export -k | sed 's/.gitignore/.cvsignore/g') | (cd tesseract-cvs && git fast-import)
cd tesseract-svn
svn_import_sha=$(git log --grep 'trunk@4 ' --oneline | cut -f1 -d' ')
git fetch ../tesseract-cvs
git replace "$svn_import_sha" FETCH_HEAD
git filter-branch --env-filter '
a="$GIT_AUTHOR_NAME"
e="$GIT_AUTHOR_EMAIL"
case "$GIT_AUTHOR_NAME" in
david.eger*) a="David Eger"; e="david.eger@gmail.com";;
joregan*) a="Jim Regan"; e="joregan@gmail.com";;
lvincent*) a="Luc Vincent"; e="";;
max.markin*) a="Max Markin"; e="max.markin@gmail.com";;
rajesh.katikam*) a="Rajesh Katikam"; e="rajesh.katikam@gmail.com";;
theraysmith*) a="Ray Smith"; e="theraysmith@gmail.com";;
zdenop*) a="zdenop"; e="zdenop@gmail.com";;
esac
export GIT_AUTHOR_NAME="$a" GIT_COMMITTER_NAME="$a" GIT_AUTHOR_EMAIL="$e" GIT_COMMITTER_EMAIL="$e"' -- master
git push git@github.com:wmanley/tesseract-ocr.git master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment