[Pkg-tcltk-devel] Team migration (alioth -> salsa)

Héctor Romojaro Gómez hector.romojaro at gmail.com
Fri Feb 23 12:50:30 UTC 2018

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://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

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-guest@git.debian.org/git/pkg-tcl
$ 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,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/pkg-tcltk-devel/attachments/20180223/1ba11248/attachment.sig>

More information about the Pkg-tcltk-devel mailing list