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

Last change on this file since 2322 was 2236, checked in by andersk, 16 years ago

broder: “I give up. I'll let Anders fix it”

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