4 # Depends: python-yaml, python-mako
5 # and svn-all-fast-export, which comes from git://repo.or.cz/svn-all-fast-export
6 # and builds with `qmake && make` with
7 # Build-Depends: qt4-qmake, libqt4-dev, libsvn-dev
9 # Usage: ./git-migrate-fast.sh [svn-uri]
10 # Exports into new subdir ./git .
11 SVN=${1:-/mit/xvm/svn}
13 mako-render rules.mako > rules
19 sed -n 's/^create repository // p' ../rules | while read repo; do
20 mkdir -p "$repo" && GIT_DIR="$repo" git init --bare
23 svn-all-fast-export --identity-map ../authors ../rules "$SVN"
25 pushd packages/invirt-dev.git
26 GIT_COMMITTER_NAME='Eric Price' GIT_COMMITTER_EMAIL='ecprice@mit.edu' GIT_COMMITTER_DATE='1206829393 -0400' \
27 git tag -a sipb-xen-dev/13 sipb-xen-dev/14~2 -F - <<EOF
28 Tag 13 of sipb-xen-dev
30 svn path=/package_tags/sipb-xen-dev/13/; revision=316
34 pushd packages/invirt-remote.git
35 echo $(git rev-parse 0.2.0^0 invirt-remote-server invirt-remote-host) >> info/grafts
36 git filter-branch --tag-name-filter cat -- ^invirt-remote-server ^invirt-remote-host --all
37 rm -rf info/grafts refs/original refs/heads/invirt-remote-server refs/heads/invirt-remote-host
40 pushd packages/invirt-console.git
41 echo $(git rev-parse 0.2.0^0 0.2.0^ invirt-console-host) >> info/grafts
42 git filter-branch --tag-name-filter cat -- ^0.2.0^ ^invirt-console-host --all
43 rm -rf info/grafts refs/original refs/heads/invirt-console-host
46 pushd packages/invirt-dns.git
47 echo $(git rev-parse sipb-xen-dns/1~10 sipb-xen-dns/1~11 dns) >> info/grafts
48 git filter-branch --tag-name-filter cat -- ^sipb-xen-dns/1~11 ^dns --all
49 rm -rf info/grafts refs/original refs/heads/dns
52 pushd packages/invirt-database.git
53 echo $(git rev-parse invirt-database-server/0.0.1^0 0.0.1^) >> info/grafts
54 echo $(git rev-parse 0.2.0^0 0.2.0^ invirt-database-server) >> info/grafts
55 git filter-branch --tag-name-filter cat -- ^0.2.0^ --all
56 rm -rf info/grafts refs/original refs/heads/invirt-database-server
59 pushd packages/python-routefs.git
60 git fetch -t git://github.com/ebroder/python-routefs.git
61 git branch -f upstream 1.0.1
62 git branch -f master 1.0.1-1
66 echo 'The Git migration was successful.'