source: trunk/scripts/git-migration/git-migrate-fast.sh @ 2356

Last change on this file since 2356 was 2356, checked in by andersk, 15 years ago

svn-all-fast-export can create annotated tags now.

  • Property svn:executable set to *
File size: 2.1 KB
Line 
1#!/bin/bash
2set -e
3
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
8
9# Usage: ./git-migrate-fast.sh [svn-uri]
10# Exports into new subdir ./git .
11SVN=${1:-/mit/xvm/svn}
12
13mako-render rules.mako > rules
14
15rm git -rf
16mkdir git
17cd git
18
19sed -n 's/^create repository // p' ../rules | while read repo; do
20    mkdir -p "$repo" && GIT_DIR="$repo" git init --bare
21done
22
23svn-all-fast-export --identity-map ../authors ../rules "$SVN"
24
25pushd packages/invirt-dev.git
26GIT_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
28Tag 13 of sipb-xen-dev
29
30svn path=/package_tags/sipb-xen-dev/13/; revision=316
31EOF
32popd
33
34pushd packages/invirt-remote.git
35echo $(git rev-parse 0.2.0^0 invirt-remote-server invirt-remote-host) >> info/grafts
36git filter-branch --tag-name-filter cat -- ^invirt-remote-server ^invirt-remote-host --all
37rm -rf info/grafts refs/original refs/heads/invirt-remote-server refs/heads/invirt-remote-host
38popd
39
40pushd packages/invirt-console.git
41echo $(git rev-parse 0.2.0^0 0.2.0^ invirt-console-host) >> info/grafts
42git filter-branch --tag-name-filter cat -- ^0.2.0^ ^invirt-console-host --all
43rm -rf info/grafts refs/original refs/heads/invirt-console-host
44popd
45
46pushd packages/invirt-dns.git
47echo $(git rev-parse sipb-xen-dns/1~10 sipb-xen-dns/1~11 dns) >> info/grafts
48git filter-branch --tag-name-filter cat -- ^sipb-xen-dns/1~11 ^dns --all
49rm -rf info/grafts refs/original refs/heads/dns
50popd
51
52pushd packages/invirt-database.git
53echo $(git rev-parse invirt-database-server/0.0.1^0 0.0.1^) >> info/grafts
54echo $(git rev-parse 0.2.0^0 0.2.0^ invirt-database-server) >> info/grafts
55git filter-branch --tag-name-filter cat -- ^0.2.0^ --all
56rm -rf info/grafts refs/original refs/heads/invirt-database-server
57popd
58
59pushd packages/python-routefs.git
60git fetch -t git://github.com/ebroder/python-routefs.git
61git branch -f upstream 1.0.1
62git branch -f master 1.0.1-1
63popd
64
65echo
66echo 'The Git migration was successful.'
Note: See TracBrowser for help on using the repository browser.