Skip to content

Instantly share code, notes, and snippets.

@glensc
Forked from petterl/create_repo.sh
Last active December 11, 2015 07:28
Show Gist options
  • Save glensc/4566142 to your computer and use it in GitHub Desktop.
Save glensc/4566142 to your computer and use it in GitHub Desktop.
eventum bzr to git migrate
# authors file for Eventum bzr2git migration
apache=svnadmin
!balsdorf=Bryan Alsdorf <[email protected]>
balsdorf=Bryan Alsdorf <[email protected]>
bkbits.net!cvsexport=bk2cvs
Bryan Alsdorf <bryan@achilles>=Bryan Alsdorf <[email protected]>
Bryan Alsdorf <[email protected]>=Bryan Alsdorf <[email protected]>
Bryan Alsdorf <[email protected]>=Bryan Alsdorf <[email protected]>
[email protected]=Bryan Alsdorf <[email protected]>
!bryan=Bryan Alsdorf <[email protected]>
[email protected]=Bryan Alsdorf <[email protected]>
<Elan>=Elan Ruusamäe <[email protected]>
[email protected]=Elan Ruusamäe <[email protected]>
glen=Elan Ruusamäe <[email protected]>
Harri Porten <porten@greco>=Harri Porten <[email protected]>
Hartmut Holzgraefe <[email protected]>=Hartmut Holzgraefe <[email protected]>
jesushatesjava.com!balsdorf=Bryan Alsdorf <[email protected]>
jesushatesjava.com!bryan/balsdorf=Bryan Alsdorf <[email protected]>
kbrown=Kirk Brown <[email protected]>
Launchpad Code Hosting <codehost@crowberry>=Elan Ruusamäe (Launchpad Translations) <[email protected]>
Launchpad Translations on behalf of glen666=Elan Ruusamäe (Launchpad Translations) <[email protected]>
mroszyk=Matt Roszyk <[email protected]>
mysql.com!bryan=Bryan Alsdorf <[email protected]>
mysql.com!ebraswell2=Eric <[email protected]>
mysql.com!jimw=Jim Winstead <>
mysql.com!jpm=João Prado Maia <[email protected]>
mysql.com!lgrimmer=Lenz Grimmer <[email protected]>
rlambe=Ray Lambe <[email protected]>
=?utf-8?q?Elan_Ruusam=C3=A4e?= <[email protected]>=Elan Ruusamäe <[email protected]>
#!/bin/sh
set -e
dir=$(dirname "$0")
dir=$(cd "$dir"; pwd)
# checkout bazaar locally, to cut down network traffic if want to restart process
test -d eventum.bzr || bzr branch lp:eventum eventum.bzr
# live one
#bzr_upstream=lp:eventum
# test one
bzr_upstream=$dir/eventum.bzr
# TODO:
# - use bare repo: https://github.com/termie/git-bzr-ng/issues/52
# Create repo
# mkdir, so it will fail if dir exists
mkdir eventum.git
cd eventum.git
git init
# Prepare for bzr
install -d .git/bzr/{map,repo}
bzr init-repo --no-trees .git/bzr/repo
bzr branch $bzr_upstream .git/bzr/repo/master
# Fast-export the bzr repo
test -s $dir/bzr-fast-export.raw || \
bzr fast-export --plain --export-marks=.git/bzr/map/master-bzr --git-branch=bzr/master .git/bzr/repo/master \
> $dir/bzr-fast-export.raw
test -s $dir/bzr-fast-export || \
bzr fast-import-filter --user-map=$dir/authors > $dir/bzr-fast-export < $dir/bzr-fast-export.raw
# Import into git
git fast-import --export-marks=.git/bzr/map/master-git < $dir/bzr-fast-export
rm -f $dir/bzr-fast-export*
git branch master bzr/master
git config bzr.master.bzr bzr/master
git config bzr.bzr/master.upstream $bzr_upstream
# make some space
# 115MiB -> 36MiB
git gc --prune=now --aggressive
#git gc --aggressive
git repack -a -d -f -F --window=250 --depth=250
#git remote add github [email protected]:petterl/eventum.git
#git remote add github [email protected]:glensc/eventum.git
#git push -u github master
#!/bin/sh
set -e
dir=$(dirname "$0")
dir=$(cd "$dir"; pwd)
# pull bzr and git changes
cd $dir/eventum.bzr
bzr pull
cd $dir/eventum.git
git pull
# first pull bzr->git
git bzr pull
# then push git->bzr
git bzr push
# and distribute changes
#git push origin master
cd $dir/eventum.bzr
#bzr push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment