[pkg-java-svn2git] 01/01: Initial commit

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Mon May 19 21:29:50 UTC 2014


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository pkg-java-svn2git.

commit 8f1174a68f50912fd8a1198eedb400bec9ca7bf1
Author: Emmanuel Bourg <ebourg at apache.org>
Date:   Mon May 19 23:29:05 2014 +0200

    Initial commit
---
 README.txt              |  33 ++++++++++++++
 migrate-svn-repo-to-git | 102 ++++++++++++++++++++++++++++++++++++++++++++
 pkg-java-authors.txt    | 111 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 246 insertions(+)

diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..c34e086
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,33 @@
+Migrate pkg-java repositories to Git
+------------------------------------
+
+This script automates the migration of a Java package managed in the Subversion
+repository on alioth to a Git repository.
+
+The script performs the following tasks:
+
+1. Import the SVN repository with its tags into a local Git repository and
+   create an empty upstream branch ready to be used with git-import-orig
+2. Update the Vcs-* fields in debian/control
+3. Add an entry in debian/changelog mentioning the move
+4. Push the new Git repository
+5. Add a MOVED_TO_GIT.txt file in the SVN repository documenting the migration
+
+
+Usage
+-----
+
+Run:
+
+    ./migrate-svn-repo-to-git <packagename>
+
+
+Prerequisites
+-------------
+
+git-svn must be installed before running this script:
+
+    apt-get install git-svn
+
+The script assumes that SSH is properly configured on the local machine such
+that connections to alioth can be performed without specifying the username.
diff --git a/migrate-svn-repo-to-git b/migrate-svn-repo-to-git
new file mode 100755
index 0000000..3de1d9a
--- /dev/null
+++ b/migrate-svn-repo-to-git
@@ -0,0 +1,102 @@
+#!/bin/bash
+#
+# Script to migrate a package from SVN to Git on Alioth.
+# This script is tailored for the packages maintained by the Java team.
+#
+
+if [ -z "$1" ]; then
+    echo "Usage: ./migrate-svn-repo-to-git <packagename>"
+    exit 1;
+fi
+
+PACKAGE=$1
+TEAM=pkg-java
+
+#TODO connect to alioth and check if the repository has already been converted
+
+# Create an empty Git repository with an upstream branch
+echo "Initializing the Git repository..."
+git init $PACKAGE
+pushd $PACKAGE
+git checkout --orphan upstream
+git commit --allow-empty -m 'Initial upstream branch.'
+git checkout --orphan master
+
+git remote add origin git+ssh://git.debian.org/git/pkg-java/$PACKAGE
+
+# Clone the SVN repository
+echo "Cloning the SVN repository.."
+git svn clone --authors-file=../$TEAM-authors.txt \
+              --no-metadata \
+              --trunk=trunk/$PACKAGE \
+              --tags=tags/$PACKAGE \
+              svn+ssh://svn.debian.org/svn/$TEAM/ \
+              .
+git reset --hard
+
+# Turn the branches into tags
+echo "Converting branches to tags..."
+for branch in `git branch -r`; do
+    if [ `echo $branch | egrep "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
+
+# Remove the remotes/origin/trunk reference
+git branch -rd origin/trunk
+
+# Update the Vcs-* fields
+echo "Updating debian/control..."
+sed -i 's#http://anonscm.debian.org/viewvc/$TEAM/trunk/\([^/]*\)/\?#http://anonscm.debian.org/gitweb/?p=$TEAM/\1.git#g' debian/control
+sed -i 's#http://svn.debian.org/wsvn/$TEAM/trunk/\([^/]*\)/\?#http://anonscm.debian.org/gitweb/?p=$TEAM/\1.git#g' debian/control
+
+sed -i 's#Vcs-Svn: svn://anonscm.debian.org/$TEAM/trunk/\([^/]*\)/\?#Vcs-Git: git://anonscm.debian.org/$TEAM/\1.git#g' debian/control
+sed -i 's#Vcs-Svn: svn://svn.debian.org/svn/$TEAM/trunk/\([^/]*\)/\?#Vcs-Git: git://anonscm.debian.org/$TEAM/\1.git#g' debian/control
+
+echo "Updated Vcs-* fields:"
+grep Vcs- debian/control
+
+# Document the migration in debian/changelog
+dch 'Moved the package to Git'
+
+# Commit the changes
+git commit debian/control debian/changelog -m 'Moved the package to Git'
+
+echo ""
+while true; do
+    read -p "Do you want to push the migrated repository now? [yN] " choice
+    case $choice in
+        [Yy]* ) break;;
+        * ) exit;;
+    esac
+done
+
+# Create the Git repository on alioth
+echo "Creating the Git repository on alioth..."
+ssh alioth.debian.org "cd /srv/git.debian.org/git/pkg-java && ./setup-repository $PACKAGE"
+
+# Push the new repository
+echo "Pushing the new repository..."
+git push --all
+git push --tags
+
+# Add a file in the SVN repository documenting the migration
+echo "Marking the SVN repository as obsolete..."
+svn checkout svn+ssh://svn.debian.org/svn/$TEAM/trunk/$PACKAGE . --depth empty
+echo "The $PACKAGE package is now maintained in a Git repository.
+Please clone git+ssh://anonscm.debian.org/$TEAM/$PACKAGE to work on this package.
+" > MOVED_TO_GIT.txt
+
+svn add MOVED_TO_GIT.txt
+svn commit MOVED_TO_GIT.txt -m "Moved $PACKAGE to Git"
+rm -Rf MOVED_TO_GIT.txt .svn
+
+echo ""
+echo "Migration completed"
+echo "New repository located at git+ssh://git.debian.org/git/$TEAM/$PACKAGE"
+echo ""
diff --git a/pkg-java-authors.txt b/pkg-java-authors.txt
new file mode 100644
index 0000000..5c89dda
--- /dev/null
+++ b/pkg-java-authors.txt
@@ -0,0 +1,111 @@
+adrianperez-guest = Adrian Perez <adrianperez.deb at gmail.com>
+aelmahmoudy-guest = Ahmed El-Mahmoudy <aelmahmoudy at sabily.org>
+akumar = Kumar Appaiah <akumar at debian.org>
+apeeters-guest = Adriaan Peeters <apeeters at lashout.net>
+apo-guest = Markus Koschany <apo at gambaru.de>
+arnaud-guest = Arnaud Vandyck <avdyk at debian.org>
+avdyk = Arnaud Vandyck <avdyk at debian.org>
+barryh-guest = Barry Hawkins <barry.hawkins at gmail.com>
+bayle = Christian Bayle <bayle at debian.org>
+bdrung = Benjamin Drung <bdrung at debian.org>
+bortz = Stephane Bortzmeyer <bortz at debian.org>
+cedricpineau-guest = Cédric Pineau <cedric.pineau at gmail.com>
+cfry = Charles Fry <cfry at debian.org>
+cfry-guest = Charles Fry <cfry at debian.org>
+claviola = Carlos Laviola <claviola at debian.org>
+dirson = Yann Dirson <dirson at debian.org>
+dleidert-guest = Daniel Leidert <daniel.leidert.spam at gmx.net>
+doko = Matthias Klose <doko at debian.org>
+dominik-guest = Dominik Smatana <dominik at fsf.sk>
+drazzib = Damien Raude-Morvan <drazzib at debian.org>
+drazzib-guest = Damien Raude-Morvan <drazzib at debian.org>
+ebourg-guest = Emmanuel Bourg <ebourg at apache.org>
+egonw-guest = Egon Willighagen <egonw at users.sf.net>
+erich = Erich Schubert <erich at debian.org>
+eugene-guest = Eugene Zhukov <jevgeni.zh at gmail.com>
+ewl-guest = Eric Lavarde <deb at zorglub.s.bawue.de>
+fnatter-guest = Felix Natter <fnatter at gmx.net>
+fourmond = Vincent Fourmond <fourmond at debian.org>
+gerardo-guest = Gerardo Curiel <gcuriel at debian.org.ve>
+gg0-guest = Gabriele Giacone <1o5g4r8o at gmail.com>
+gilbert-guest = Michael Gilbert <michael.s.gilbert at gmail.com>
+gio = Giovanni Mascellani <gio at debian.org>
+gmascellani-guest = Giovanni Mascellani <gio at debian.org>
+gmazoyer-guest = Guillaume Mazoyer <respawneral at gmail.com>
+goonie-guest = Andreas Schildbach <andreas at schildbach.de>
+gregoa = Gregor Herrmann <gregoa at debian.org>
+hauro-guest = Manuel Prinz <debian at pinguinkiste.de>
+ieugen-guest = Stan Ioan-Eugen <stan.ieugen at gmail.com>
+jab = Jeff Breidenbach <jab at debian.org>
+jamespage-guest = James Page <james.page at canonical.com>
+jandd-guest = Jan Dittberner <jandd at debian.org>
+janpascal-guest = Jan-Pascal van Best <janpascal at vanbest.org>
+jasonb-guest = Jason Brittain <jason.brittain at mulesoft.com>
+jerico-guest = Florian Grandel <jerico.dev at gmail.com>
+jeroen = Jeroen van Wolffelaar <jeroen at debian.org>
+jonny = Jonny Lamb <jonny at debian.org>
+killer = Kalle Kivimaa <killer at debian.org>
+kumanna-guest = Kumar Appaiah <akumar at ee.iitm.ac.in>
+lcycon-guest = Luke Cycon <lcycon at gmail.com>
+llucifer-guest = Philipp Meier <meier at fnogol.de>
+ludovicc-guest = Ludovic Claude <ludovic.claude at laposte.net>
+maestro_alubia-guest = Fabian Köster <koesterreich at gmx.net>
+malat = Mathieu Malaterre <malat at debian.org>
+malat-guest = Mathieu Malaterre <malat at debian.org>
+manuel = Mathieu Malaterre <malat at debian.org>
+marcusb-guest = Marcus Better <marcus at better.se>
+matthias-guest = Matthias Schmitz <matthias at sigxcpu.org>
+mbanck = Michael Banck <mbanck at debian.org>
+mehdi = Mehdi Dogguy <mehdi at debian.org>
+mh = Mark Howard <mh at debian.org>
+mjj29 = Matthew Johnson <mjj29 at debian.org>
+mkoch = Michael Koch <konqueror at gmx.de>
+mkoch-guest = Michael Koch <konqueror at gmx.de>
+moeller = Steffen Möller <moeller at debian.org>
+mslama-guest = Marek Slama <marek.slama at sun.com>
+nd-guest = Andreas Putzo <andreas at putzo.net>
+nomadium-guest = Miguel Landaeta <miguel at miguel.cc>
+nthykier = Niels Thykier <nthykier at debian.org>
+nthykier-guest = Niels Thykier <nthykier at debian.org>
+ola = Ola Nordmann <olapc at yahoo.no>
+onkarshinde-guest = Onkar Shinde <onkarshinde at ubuntu.com>
+osallou = Olivier Sallou <osallou at debian.org>
+pabloduboue-guest = Pablo Duboue <pablo.duboue at gmail.com>
+paulcager-guest = Paul Cager <paul-debian at home.paulcager.org>
+pcc-guest = Peter Collingbourne <peter at pcc.me.uk>
+pere = Petter Reinholdtsen <pere at debian.org>
+periapt-guest = Nicholas Bamber <nicholas at periapt.co.uk>
+petere = Peter Eisentraut <petere at debian.org>
+rene = Rene Engelhard <rene at debian.org>
+rk13-guest = Vladimir Kotov <vladimir at kotov.lv>
+rockclimb-guest = Andrew Ross <ubuntu at rossfamily.co.uk>
+rzr-guest = Philippe Coval <rzr at gna.org>
+sgybas = Stefan Gybas <sgybas at debian.org>
+smoe-guest = Steffen Möller <moeller at debian.org>
+sonne = Soeren Sonnenburg <sonne at debian.org>
+starswifter-guest = Morten Sørensen <starswifter at gmail.com>
+sylvestre = Sylvestre Ledru <sylvestre at debian.org>
+sylvestre-guest = Sylvestre Ledru <sylvestre at debian.org>
+tashiro-guest = Stephan Michels <stephan.michels at gmail.com>
+tedp-guest = Ted Percival <ted at midg3t.net>
+tgg = Thomas Girard <tgg at debian.org>
+thkoch-guest = Thomas Koch <thomas at koch.ro>
+tiagosab-guest = Tiago Saboga <tiagosaboga at gmail.com>
+tille = Andreas Tille <tille at debian.org>
+tincho-guest = Martín Ferrari <tincho at debian.org>
+tmancill = Tony Mancill <tmancill at debian.org>
+tora = Takashi Okamoto <tora at debian.org>
+trygvis-guest = Trygve Laugstøl <trygvis at inamo.no>
+ttx-guest = Thierry Carrez <thierry.carrez at ubuntu.com>
+twerner = Torsten Werner <twerner at debian.org>
+varun = Varun Hiremath <varun at debian.org>
+varun-guest = Varun Hiremath <varun at debian.org>
+vincentc-guest = Vincent Cheng <Vincentc1208 at gmail.com>
+vladimir-guest = Vladimír Lapáček <vladimir.lapacek at gmail.com>
+wasabi-guest = Jerry Haltom <wasabi at larvalstage.net>
+wbaer-guest = Wolfgang Bär <wbaer at gmx.de>
+werner = Morten Werner Olsen <werner at debian.org>
+werner-guest = Morten Werner Olsen <werner at debian.org>
+xhaakon-guest = Jakub Adam <jakub.adam at ktknet.cz>
+yesx-guest = Shuxiong Ye <yeshuxiong at gmail.com>
+zuch-guest = Manu Mahajan <manu at codepencil.com>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/pkg-java-svn2git.git



More information about the pkg-java-commits mailing list