Dear all,

I have just migrated one of the svn repositories (tdom) to git, so far
so good. As "Master" role is required to create new repos in salsa, i
just created it in alioth, moving it to salsa should be easy

The repo is here[1], and for svn to git migration i used a similar
process to what is described in the alioth guide[2], details below.

For the authors file (users.txt) linking old alioth usernames to names
and emails, i have used the information available in the project
members page, in alioth[3].

The process in detail:

1- Convert the repository

$ git svn clone svn:// --prefix=svn-
import/ --stdlayout --authors-file=users.txt --no-metadata tdom

2- Convert remote tags and branches to local

for branch in `git branch -r`; do
    if [ `echo $branch | egrep "svn-import/tags/.+$"` ]; then
        version=`basename $branch`
        subject=`git log -1 --pretty=format:"%s" $branch`
        GIT_COMMITTER_DATE=`git log -1 --pretty=format:"%ci" $branch` \
            git tag -f -m "$subject" "debian/$version" "$branch^"

        git branch -d -r $branch

3- Remove old references and convert remote branches to locals

$ git branch -d -r svn-import/trunk
$ git config --remove-section svn-remote.svn
$ rm -rf .git/svn .git/{logs/,}refs/remotes/svn/
$ git config remote.origin.url .
$ git config --add remote.origin.fetch +refs/remotes/*:refs/heads/*
$ git fetch

4- Import upstream source

$ git symbolic-ref HEAD refs/heads/upstream
$ git rm --cached -r .
$ git commit --allow-empty -m 'initial upstream branch'
$ git checkout -f master
$ git merge upstream --allow-unrelated-histories
$ gbp import-orig ../tdom_0.9.0.orig.tar.gz

5- Create the empty repo (on alioth)

(alioth) $ /git/pkg-tcltk/packages/setup-repository tdom 'Fast
XML/DOM/XPath/XSLT extension for Tcl written in C'

6- Push our local repo (geox-guest is my alioth account)

$ git remote set-url origin ssh://
$ git push --follow-tags --force --all origin

And that's it. There are probably other ways of doing it, and perhaps a
script for automating it somewhere, but whatever. 

In any case, it looks good at first glance, but i haven't tested the
build process yet.

If it works, this could probably be easily automated for all repos, in
case the branch/tag structure fits in our workflows...


Kind regards,

Attachment: signature.asc
Description: This is a digitally signed message part

Pkg-tcltk-devel mailing list

Reply via email to