Differences between revisions 69 and 90 (spanning 21 versions)
Revision 69 as of 2009-07-24 16:51:09
Size: 4189
Editor: EddyPetrisor
Comment: git-<commands> are deprecated; git <commands> should be used instead
Revision 90 as of 2011-12-17 23:47:30
Size: 5898
Editor: ?kgoetz
Comment: add quick reference to ~/.mrtrust
Deletions are marked like this. Additions are marked like this.
Line 8: Line 8:
Most of the packages are independent from each other. In svn, a [trunk,tags,branches}/<package> scheme is used with only the debian directory stored. The .orig.tar.gz files in such a case are stored in /var/lib/gforge/chroot/home/groups/pkg-games/htdocs/tarballs in the alioth servers. They can be accessed online at [[http://pkg-games.alioth.debian.org/tarballs]]. In git, each package has it's own repository. The contents of the orig tarball are stored directly within each package's repository, inside the 'upstream' branch. The {{{pristine-tar}}} program can be used to regenerate an orig tarball from the upstream branch. Most of the packages are independent from each other. In svn, a [trunk,tags,branches}/<package> scheme is used with only the debian directory stored. The .orig.tar.gz files in such a case are stored in /home/groups/pkg-games/htdocs/tarballs in the alioth servers. They can be accessed online at [[http://pkg-games.alioth.debian.org/tarballs]]. In git, each package has it's own repository. The contents of the orig tarball are stored directly within each package's repository, inside the 'upstream' branch. The {{{pristine-tar}}} program can be used to regenerate an orig tarball from the upstream branch.
Line 47: Line 47:
== Git ==
This section describes how to create a git repository for a package as well as convert from the svn layout.
== mr ==
Line 50: Line 49:
=== Global git Configuration ===
First, you'll need to setup your global git configiration file ({{{~/.gitconfig}}}) with your name and email address. This is so commit messages show up with your name and email address automatically.
The mr command can be used to checkout, update, and commit to multiple repositories. In the svn+ssh://svn.debian.org/svn/pkg-games/mrconfig, is a .mrconfig file that configures mr for all the repositories used by the games team.

New git repositories should be added to this .mrconfig file.

To use it, install the mr package, and create a ~/.mrconfig file letting mr know about the pkg-games svn repository. In this example, it will be checked out to ~/src/packages/games, but you can modify to suit. If you already have a pkg-games svn checkout, you can change the directory to point to that. Note that the last field on the 'checkout' line ('games' in this instance) should match the last field of the configuration path ('src/packages/games').
Line 53: Line 56:
$ git config --global user.name "<your name>"
$ git config --global user.email "<your email address>"
[src/packages/games]
chain = true
checkout = svn co svn+ssh://svn.debian.org/svn/pkg-games/packages/trunk games
Line 57: Line 61:
=== Creating a git repository ===
'''These steps involve creating a brand new git repository for your package. If you are converting from svn, please see the "Converting from svn repository" section below.'''
Then run "mr checkout", which will checkout the svn repository into ~/src/packages/games. The checkout will be approximately 120MB.
Line 60: Line 63:
Here's a simple way to create a git repository using the supplied {{{setup-repository}}} script in the /git/pkg-games directory on the alioth servers. Next set up the shared games team .mrconfig. In your ~/.mrconfig, add the following entries.
Line 62: Line 66:
$ ssh <username>@git.debian.org
$ cd /git/pkg-games
$ ./setup-repository <package> '<package description>'
# Update the games team mrconfig
[src/packages/games-mrconfig]
checkout = svn co svn+ssh://svn.debian.org/svn/pkg-games/mrconfig games-mrconfig ; cp ~/src/packages/games-mrconfig/.mrconfig ~/src/packages/games/.mrconfig
Line 67: Line 71:
If you want to manually create the repository, the rest of this section describes how to do so. An 'svn up' will pull down two files into the new directory - a README and the .mrconfig file.

Before doing the final checkout (using mr), you need to setup a ~/.mrtrust file. This is supported in all versions of mr from 0.42, and is required for chained checkouts from 1.00 (January 2011). The contents of the file should be a series of paths (one per line) to .mrconfig files. In our case, it will be one line:
Line 69: Line 76:
$ ssh <username>@git.debian.org
$ cd /git/pkg-games
$ mkdir <package>.git
$ cd <package>.git
$ git --bare init --shared
/home/YOURNAME/src/packages/games/.mrconfig
Line 76: Line 79:
Now edit the 'description' file in the directory you just created to one that is appropriate for the package.
Two more "mr checkout" runs (necessary because of bug #447553) will checkout the additional git repositories, into subdirectories of ~/src/packages/games/. (As of 2010-08-14, the full debian-games repo was just under 6GB).

Now you can use mr to act on all configured repositories at once.

Update all repositories:
Line 78: Line 87:
$ echo "Packaging for <package>" >description % mr update
Line 81: Line 90:
Let's also enable the use of 'hooks/post-update'. Get status of all checkouts:
Line 83: Line 93:
$ chmod a+x hooks/post-update % mr status
Line 86: Line 96:
The following will enable the games team to receive commit mails and irc notifications about commits. Please do the following. List all repositories that mr knows about:
Line 88: Line 99:
$ git config --add hooks.mailinglist "pkg-games-commits@lists.alioth.debian.org"
$ git config --add hooks.cia-project debian-pkg-games
$ cat >hooks/post-receive <<END
#!/bin/sh
exec /usr/lo
% mr list
}}}

Or even commit changes in each repository:

{{{
% mr commit
}}}

If you've added a new git repository in ~/src/packages/games/<foo> and are in that directory, you can have mr automatically add it to the pkg-games .mrconfig file by running "mr register". (Don't forget to commit the file.)

== Git ==

See [[Games/VCS/git]].

== SVN ==

See [[Games/VCS/svn]].

== General Rules ==
 * If a package you're working on is for a particular version that has not been uploaded to the archive, you need to use 'UNRELEASED' as the suite in the changelog.
 * packages/ in the svn repo is for free games only. For games which should go to non-free, please use non-free/package/.
 * the SVN properties of the debian/ directory should point to the location where the orig.tar.gz file(s) can be fetched.

== See Also ==
 * [[Alioth/Git]]
 * http://www.kernel.org/pub/software/scm/git/docs/ - git Documentation
 * [[SmallSVNTutorial]]
 * [[Alioth/Svn]]
 * http://svnbook.red-bean.com/ - Subversion Documentation
 * [[http://www.hmug.org/man/5/ssh_config.php|ssh_config man page]] - Manual on OpenSSH SSH client configuration files
 * [[http://git.or.cz/gitwiki/GitCheatSheet]] - Git Cheat

The Debian Games Team currently uses either git or svn to help in maintaining packages. This page will help you get started in using either git or svn repositories.

Scheme

Most of the packages are independent from each other. In svn, a [trunk,tags,branches}/<package> scheme is used with only the debian directory stored. The .orig.tar.gz files in such a case are stored in /home/groups/pkg-games/htdocs/tarballs in the alioth servers. They can be accessed online at http://pkg-games.alioth.debian.org/tarballs. In git, each package has it's own repository. The contents of the orig tarball are stored directly within each package's repository, inside the 'upstream' branch. The pristine-tar program can be used to regenerate an orig tarball from the upstream branch.

Setting up

The first thing to do is get an account on alioth.debian.org. Visit the following link.

The next step is to join the team. Visit the Alioth page for the team and click on "request to join".

Next, you will need an ssh key for each computer you plan on working on packages with. If you don't have a key on a particular system, create one.

$ ssh-keygen

This should have created an RSA key for SSH protocol 2 by default. Upload the contents of your public keys (~/.ssh/id_rsa.pub) to your account in Alioth. To do this, copy the contents of each public key for your machines and paste them at the following link.

Next, create an SSH configuration file (~/.ssh/config) for your user profile to work with the alioth servers. Here's how to do the following in a terminal session.

$ cat >>~/.ssh/config <<EOF
Host svn.debian.org
        User <username>

Host git.debian.org
        User <username>

Host alioth.debian.org
        User <username>
EOF

Now you should be able to logon from each of your machines by doing the following.

$ ssh svn.debian.org
$ ssh git.debian.org
$ ssh alioth.debian.org

Note: There's usually a one hour delay when uploading your ssh public keys. During this delay, you can still login with your password.

mr

The mr command can be used to checkout, update, and commit to multiple repositories. In the svn+ssh://svn.debian.org/svn/pkg-games/mrconfig, is a .mrconfig file that configures mr for all the repositories used by the games team.

New git repositories should be added to this .mrconfig file.

To use it, install the mr package, and create a ~/.mrconfig file letting mr know about the pkg-games svn repository. In this example, it will be checked out to ~/src/packages/games, but you can modify to suit. If you already have a pkg-games svn checkout, you can change the directory to point to that. Note that the last field on the 'checkout' line ('games' in this instance) should match the last field of the configuration path ('src/packages/games').

[src/packages/games]
chain = true
checkout = svn co svn+ssh://svn.debian.org/svn/pkg-games/packages/trunk games

Then run "mr checkout", which will checkout the svn repository into ~/src/packages/games. The checkout will be approximately 120MB.

Next set up the shared games team .mrconfig. In your ~/.mrconfig, add the following entries.

# Update the games team mrconfig
[src/packages/games-mrconfig]
checkout = svn co svn+ssh://svn.debian.org/svn/pkg-games/mrconfig games-mrconfig ; cp ~/src/packages/games-mrconfig/.mrconfig ~/src/packages/games/.mrconfig

An 'svn up' will pull down two files into the new directory - a README and the .mrconfig file.

Before doing the final checkout (using mr), you need to setup a ~/.mrtrust file. This is supported in all versions of mr from 0.42, and is required for chained checkouts from 1.00 (January 2011). The contents of the file should be a series of paths (one per line) to .mrconfig files. In our case, it will be one line:

/home/YOURNAME/src/packages/games/.mrconfig

Two more "mr checkout" runs (necessary because of bug #447553) will checkout the additional git repositories, into subdirectories of ~/src/packages/games/. (As of 2010-08-14, the full debian-games repo was just under 6GB).

Now you can use mr to act on all configured repositories at once.

Update all repositories:

% mr update

Get status of all checkouts:

% mr status

List all repositories that mr knows about:

% mr list

Or even commit changes in each repository:

% mr commit

If you've added a new git repository in ~/src/packages/games/<foo> and are in that directory, you can have mr automatically add it to the pkg-games .mrconfig file by running "mr register". (Don't forget to commit the file.)

Git

See Games/VCS/git.

SVN

See Games/VCS/svn.

General Rules

  • If a package you're working on is for a particular version that has not been uploaded to the archive, you need to use 'UNRELEASED' as the suite in the changelog.
  • packages/ in the svn repo is for free games only. For games which should go to non-free, please use non-free/package/.
  • the SVN properties of the debian/ directory should point to the location where the orig.tar.gz file(s) can be fetched.

See Also