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
afterwards.

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://anonscm.debian.org/pkg-tcltk/tdom/ --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
    fi
done

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://geox-gu...@git.debian.org/git/pkg-tcl
tk/packages/tdom.git
$ 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...

[1] https://anonscm.debian.org/cgit/pkg-tcltk/packages/tdom.git/
[2] https://wiki.debian.org/de/Alioth/Git#Convert_a_SVN_Alioth_repository_to_Git
[3] https://alioth.debian.org/project/memberlist.php?group_id=30825

Kind regards,
Héctor

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

_______________________________________________
Pkg-tcltk-devel mailing list
Pkg-tcltk-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-tcltk-devel

Reply via email to