From Mageia wiki
Jump to: navigation, search

Migration of Mageia (and Mandriva) Subversion Repositories to git

Note this does NOT include migrating packages VCS to git (although this is in the works too - and it is fortunately much more scriptable).

Work is already well under way. Several trees from subversion have been converted already and are linked below. If you are coming here after being referred to it when trying to commit to subversion, then there are a few tips below.

Using Git

Git is similar to Subversion in several ways but is much more powerful and has much more advanced workflows for easier offline work. There are lots of guides out there for using git, so there is little point in listing generic instructions here, but here are some recommendations.

  • Use your @mageia.org email address if you can. This is not mandatory, but it's nice to keep the profile of Mageia represented in the commits. We would also encourage using your @mageia.org address for upstream contributions too.
  • Add the following lines to your ~/.gitconfig file to allow easy cloning/pushing via commands similar to "git clone mga:software/rpm/urpmi" (i.e. missing out the long part of the URLs:
[url "git://git.mageia.org/"]
        insteadof = mga:
[url "ssh://git@git.mageia.org/"]
        pushInsteadof = mga:

Process of Migration

  • Mandriva "soft" SVN repositories converted to git via git-svn with proper author name translation.
  • A script to import Mageia SVN repositories has been written. This script:
    • Takes the initial Mandriva git-svn git repository and resets it to our branch point.
    • Takes the Mageia SVN repository and synthesises a commit to bring the two trees into line.
    • Hacks git-svn metadata
    • Convinces git-svn to continue and import Mageia SVN up to the present day with proper author name translation.
    • Converts tags to proper annotated tags
    • Writes out SQL to keep track of SVN Revision -> git SHA1 for each software for future use.

Git Authentication

Authentication is handled by gitolite to allow for fine grained permissions. This work was done by Nicolas Vigier (boklm).

Push access to each git repo is ultimately determined through LDAP group memberships. The mgagit tool queries the LDAP server (with the command mgagit glrun) and writes group members into files in /var/lib/git/.gitolite/conf/ in gitolite format, alongside ACLs for each repository. Repo write access is defined by the top-level repo hieararchy (artwork/, qa/, software/, etc.) and is created from templates specified in https://gitweb.mageia.org/infrastructure/puppet/tree/deployment/mgagit/manifests/init.pp Usually, this consists of the members of the LDAP group %mga-X where X is that top-level hiearchy (%mga-artwork, %mga-qa, etc.), and the individual git repo owner. That owner is specified in a file in one of the meta-repos in infrastructure/repositories/ which defines all the git repos that exist.

Since gitolite does not access LDAP directly but uses the cached group membership information written by mgagit, they can become out of date. Whenever any commit is pushed to any infrastructure/repositories/ repo, a git hook automatically regenerates the LDAP group membership files for gitolite. These repos are updated very infrequently, so if you expect to have push access to a repository but don't, and you are in the correct LDAP group, ask a sysadmin to regenerate the gitolite files.

Git Layout

The subversion layout is a bit "shove it in soft" at the moment. Some thought and care will be put in to make sure the git layout is sensible.

Generally speaking we'll split repos out into main top-level areas. Currently "Software" and "Web" but others will be added in due course. For each top level, there is a Git repository that actually defines the git repositories within them. Cloning this repository and adding an appropriate *.repo file will create that git repository automatically on push.

Repository Layout

Subversion Module Git Tree (final module by same name)
AdminPanel software/adminpanel
Mkcd-Commandline software/perl/mkcd-commandline
autorun software/autorun
bootloader-utils software/bootloader-utils
bootsplash software/bootsplash
build_system/README.md software/build-system/+documentation Read Docs NB: This is a documentation repo for the build-system. It contains only a README.md file
build_system/bcd software/build-system/bcd
build_system/iurt software/build-system/iurt
build_system/mga-youri-core software/build-system/mga-youri-core
build_system/mga-youri-submit software/build-system/mga-youri-submit
build_system/mgarepo software/build-system/mgarepo
build_system/web web/pkgsubmit Is this tarballed and released or checked out directly on server? If the latter, then perhaps it should be migrated to web/pkgsubmit to match the other web projects? It is checkout out directly on server, moving it to pkgsubmit would be appropriate (rda)
common Abandon??
control-center software/control-center
cpufreq software/cpufreq
dashboard [no stdlayout] software/build-system/
desktop-common-data software/desktop/common-data (NB: the file "menu-categories-list" will be lost...)
drak3d software/drak3d
drakguard software/drakguard
draklive software/build-system/draklive (NB: moved from /software/build-system on 1st Sept 2013 after discussions with tmb/blino)
draklive-install software/draklive-install
drakmenustyle software/drakmenustyle
drakpxelinux software/drakpxelinux
drakwizard software/drakwizard
drakx software/drakx NB: Reimported 27th August 2013 to skip three more noop commits.
drakx-installer-help software/drakx-installer-help
drakx-kbd-mouse-x11 software/drakx-kbd-mouse-x11
drakx-net software/drakx-net
gpg [no stdlayout] software/infrastructure/gpg
i18n-tools [no stdlayout] software/i18n/tools
identity/CatDap web/identity
images-config/draklive software/build-system/draklive-config (NB: moved from /software/build-system/draklive on 1st Sept 2013 after discussions with tmb/blino) (should probably be build-system/draklive as its the same place bcd and its configs are / tmb)
indexhtml software/indexhtml
isocheck software/isocheck
kde4-splash-mga software/desktop/kde/splash
ldetect software/ldetect
ldetect-lst software/ldetect-lst
lxdm-theme-mageia software/desktop/lxde/theme-dm
mageia-doc software/
mageia-doc-media [no stdlayout] software/
mageia-galaxy-data software/
mageia-kde-translation software/i18n/kde
mageia-kde4-config software/desktop/kde/config
mageia-lxde-config software/desktop/lxde/config
mageia-xfce-config software/desktop/xfce/config
mandi software/mandi
mga-advisories software/infrastructure/mgaadvisories
mga-gnome software/desktop/gnome/mgagnome (renamed on request of maintainer)
mga-mirrors software/infrastructure/mgamirrors/
mga-treasurer software/infrastructure/mgatres
mgaonline software/mgaonline
mgapeople software/infrastructure/mgapeople
mgasoft software/infrastructure/mgasoft
mgasvnstats software/infrastructure/mgasvnstats
mgatools software/infrastructure/mgatools
monitor-edid software/monitor-edid
msec software/msec
multiarch-utils software/multiarch-utils
numlock software/numlock
perl-Hal-Cdroms software/perl/perl-Hal-Cdroms
perl-MDK-Common software/perl/perl-MDK-Common
perl-Parse-EDID software/perl/perl-Parse-EDID NB: Reimported 27th August 2013 to fix commit dates
perl_checker software/perl/perl_checker
release software/infrastructure/release
repoctl software/infrastructure/repoctl
rootfiles software/rootfiles
rpm/debuginfo-install Abandon. It's in gdb package SOURCES anyway (with more history and more code)
rpm/perl-URPM software/rpm/perl-URPM (or software/perl/ ??)
rpm/rpm-helper software/rpm/rpm-helper
rpm/rpm-setup software/rpm/rpm-setup
rpm/rpmtools software/rpm/rpmtools
rpm/spec-helper software/rpm/spec-helper
rpm/urpmi software/rpm/urpmi
rpmdrake software/rpmdrake
setup software/setup
system-config-printer software/i18n/system-config-printer
theme/ia_ora-gnome software/desktop/gnome/
theme/ia_ora-kde4 software/desktop/kde/
theme/mageia-gfxboot-theme software/design/bootloader-theme
theme/mageia-theme software/design/theme
theme/xsettings-kde Migrated to Upstream KDE as documented.
transfugdrake software/transfugdrake
urpmi-proxy software/rpm/urpmi-proxy
usbdumper software/usbdumper
userdrake2 software/userdrake