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

Last change on this file since 2353 was 2353, checked in by price, 15 years ago

dependency and usage notes for git-migrate-fast.sh

  • 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
25sed -n 's/^create repository // p' ../rules | while read repo; do
26    if [ -e "$repo/refs/heads/tags" ]; then
27        cp -a "$repo/refs/heads/tags/." "$repo/refs/tags"
28        rm -rf "$repo/refs/heads/tags"
29    fi
30done
31
32pushd packages/invirt-dev.git
33git tag sipb-xen-dev/13 sipb-xen-dev/14~2
34popd
35
36pushd packages/invirt-remote.git
37echo $(git rev-parse 0.2.0 invirt-remote-server invirt-remote-host) >> info/grafts
38git filter-branch --tag-name-filter cat -- ^invirt-remote-server ^invirt-remote-host --all
39rm -rf info/grafts refs/original refs/heads/invirt-remote-server refs/heads/invirt-remote-host
40popd
41
42pushd packages/invirt-console.git
43echo $(git rev-parse 0.2.0 0.2.0^ invirt-console-host) >> info/grafts
44git filter-branch --tag-name-filter cat -- ^0.2.0^ ^invirt-console-host --all
45rm -rf info/grafts refs/original refs/heads/invirt-console-host
46popd
47
48pushd packages/invirt-dns.git
49echo $(git rev-parse sipb-xen-dns/1~10 sipb-xen-dns/1~11 dns) >> info/grafts
50git filter-branch --tag-name-filter cat -- ^sipb-xen-dns/1~11 ^dns --all
51rm -rf info/grafts refs/original refs/heads/dns
52popd
53
54pushd packages/invirt-database.git
55echo $(git rev-parse invirt-database-server/0.0.1 0.0.1^) >> info/grafts
56echo $(git rev-parse 0.2.0 0.2.0^ invirt-database-server) >> info/grafts
57git filter-branch --tag-name-filter cat -- ^0.2.0^ --all
58rm -rf info/grafts refs/original refs/heads/invirt-database-server
59popd
60
61pushd packages/python-routefs.git
62git fetch -t git://github.com/ebroder/python-routefs.git
63git branch -f upstream 1.0.1
64git branch -f master 1.0.1-1
65popd
66
67echo
68echo 'The Git migration was successful.'
Note: See TracBrowser for help on using the repository browser.