Mention my svn-all-fast-export localtime branch in the comment
[invirt/scripts/git-migration.git] / git-migrate-fast.sh
index a15e01b..66be321 100755 (executable)
@@ -1,6 +1,14 @@
 #!/bin/bash
 set -e
 
+# Depends: python-yaml, python-mako
+# and svn-all-fast-export, which comes from git://repo.or.cz/svn-all-fast-export
+# (except you actually want git://andersk.mit.edu/svn-all-fast-export localtime)
+# and builds with `qmake && make` with
+#   Build-Depends: libqt4-dev, libsvn-dev
+
+# Usage: ./git-migrate-fast.sh [svn-uri]
+# Exports into new subdir ./git .
 SVN=${1:-/mit/xvm/svn}
 
 mako-render rules.mako > rules
@@ -15,25 +23,23 @@ done
 
 svn-all-fast-export --identity-map ../authors ../rules "$SVN"
 
-sed -n 's/^create repository // p' ../rules | while read repo; do
-    if [ -e "$repo/refs/heads/tags" ]; then
-        cp -a "$repo/refs/heads/tags/." "$repo/refs/tags"
-        rm -rf "$repo/refs/heads/tags"
-    fi
-done
-
 pushd packages/invirt-dev.git
-git tag sipb-xen-dev/13 sipb-xen-dev/14~2
+GIT_COMMITTER_NAME='Eric Price' GIT_COMMITTER_EMAIL='ecprice@mit.edu' GIT_COMMITTER_DATE='1206829393 -0400' \
+    git tag -a sipb-xen-dev/13 sipb-xen-dev/14~2 -F - <<EOF
+Tag 13 of sipb-xen-dev
+
+svn path=/package_tags/sipb-xen-dev/13/; revision=316
+EOF
 popd
 
 pushd packages/invirt-remote.git
-echo $(git rev-parse 0.2.0 invirt-remote-server invirt-remote-host) >> info/grafts
+echo $(git rev-parse 0.2.0^0 invirt-remote-server invirt-remote-host) >> info/grafts
 git filter-branch --tag-name-filter cat -- ^invirt-remote-server ^invirt-remote-host --all
 rm -rf info/grafts refs/original refs/heads/invirt-remote-server refs/heads/invirt-remote-host
 popd
 
 pushd packages/invirt-console.git
-echo $(git rev-parse 0.2.0 0.2.0^ invirt-console-host) >> info/grafts
+echo $(git rev-parse 0.2.0^0 0.2.0^ invirt-console-host) >> info/grafts
 git filter-branch --tag-name-filter cat -- ^0.2.0^ ^invirt-console-host --all
 rm -rf info/grafts refs/original refs/heads/invirt-console-host
 popd
@@ -44,11 +50,11 @@ git filter-branch --tag-name-filter cat -- ^sipb-xen-dns/1~11 ^dns --all
 rm -rf info/grafts refs/original refs/heads/dns
 popd
 
-pushd packages/invirt-database-server.git
-git fetch ../invirt-database.git refs/tags/0.0.1:refs/heads/tmp
-echo $(git rev-parse 0.0.1 refs/heads/tmp^) >> info/grafts
-git filter-branch --tag-name-filter cat -- ^refs/heads/tmp --all
-rm -rf info/grafts refs/original refs/heads/tmp
+pushd packages/invirt-database.git
+echo $(git rev-parse invirt-database-server/0.0.1^0 0.0.1^) >> info/grafts
+echo $(git rev-parse 0.2.0^0 0.2.0^ invirt-database-server) >> info/grafts
+git filter-branch --tag-name-filter cat -- ^0.2.0^ --all
+rm -rf info/grafts refs/original refs/heads/invirt-database-server
 popd
 
 pushd packages/python-routefs.git