Maintainer Cheatpage


Copyright (C) 2008 Daniel Baumann <daniel@debian.org>

This information is free: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This work is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

On Debian systems, the complete text of the GNU General Public License
can be found in /usr/share/common-licenses/GPL-3 file.

Table of Contents


1. Definitions

Note: This cheatpage assumes that you are using git-core 1.5.6 or newer.

changeslist:name of the commit mailinglist
ciaproject:name of the cia project
package:name of the source package of your program
project:name of the alioth project
revision:debian version string
username:name of the alioth account
version:upstream version string
^

2. Preparations

  1. Install git
    # apt-get install git-core
    
  2. Install pristine-tar
    # apt-get install pristine-tar
    
  3. Install git-buildpackage
    # apt-get install git-buildpackage
    
^

3. Handling new packages

3.1 Preparing upstream tarball

  1. Download upstream source tarball.

  2. Rename it to package_version.orig.tar.gz.

^

3.2 Preparing git repository

  1. Create an empty git repository:
    $ mkdir program
    $ cd program
    $ git init --shared
    
  2. Unpack upstream sources into the git repository.

  3. Import upstream into git:
    $ git add .
    $ git commit -a -m "Adding upstream version version."
    $ git tag -a -m "Tagging upstream version version." upstream/version
    
  4. Create upstream branch (by renaming master):
    $ git branch -m master upstream
    
  5. Import pristine-tar delta:
    $ pristine-tar commit -m "Adding pristine-tar version version." ../program_version.orig.tar.gz
    
  6. Create debian branch:
    $ git branch debian
    
  7. Prepare bare git repository:
    $ cd ..
    $ git clone --bare program program.git
    $ cd program.git
    
  8. Add gitweb description:
    $ echo "project/program" > description
    
  9. Add commit notifiers (cia and mailinglist):
    $ cat >> config << EOF
    [hooks]
            cia-project = ciaproject
            mailinglist = changeslist@lists.alioth.debian.org
    EOF
    
    $ mv hooks/post-receive hooks/post-receive.orig
    
    $ cat > hooks/post-receive << EOF
    #!/bin/sh
    exec /usr/local/bin/git-commit-notice
    EOF
    
    $ chmod 0755 hooks/post-receive
    
    $ cd ..
    
  10. Upload git repository to alioth:
    $ scp -r package.git username@alioth.debian.org:/git/project
    
  11. Remeber to make sure that the files on alioth do have read-write permissions for your alioth group.
^

4. Handling existing package

4.1 Checking out

  1. Checkout repository:
    $ git clone ssh://username@git.debian.org/git/project/package.git
    
  2. Checkout branches:
    $ cd package
    
    $ git checkout -b upstream origin/upstream
    $ git checkout -b pristine-tar origin/pristine-tar
    
  3. Switch to debian branch:
    $ git checkout debian
    
^

4.2 Checking in

  1. Make sure that you are on the debian branch:
    $ cd package
    
    $ git checkout debian
    
  2. Do your modifications on the package here. Remeber to not touch debian/changelog at all, it will be later automatically generated from the git log.

  3. Commit changes:
    $ git commit -a -m "My commit message."
    
  4. After a bunch of commits, you push changes:
    $ git push
    
^

4.3 Adding new Upstream version

  1. Make sure that you are on the upstream branch:
    $ cd package
    
    $ git checkout upstream
    
  2. Removing current files
    $ rm -rf *
    
  3. Unpacking new upstream sources into the git repository.

  4. Adding files
    $ git add .
    $ git commit -a -m "Adding upstream version version."
    
  5. Tagging
    $ git tag -a -m "Tagging upstream version version." upstream/version
    
  6. Upstream tarball
    $ pristine-tar commit -m "Adding pristine-tar version version." ../package_version.orig.tar.gz
    
  7. Make sure that you are on the debian branch:
    $ git checkout debian
    
  8. Merging
    $ git cherry-pick -n upstream
    $ git commit -a -m "Merging upstream version version
    
  9. Pushing
    $ git push
    $ git push --tags
    
^

4.4 Releasing new Debian version

  1. Creating changelog
    $ git-dch --debian-branch debian --release --since HASH
    
  2. Releasing
    $ git commit -a -m "Releasing debian version version-revision."
    
  3. Tagging
    $ git tag -a -m "Tagging debian version version-revision." debian/version-revision
    
  4. Pushing
    $ git push
    $ git push --tags
    
  5. Upstream tarball
    $ pristine-tar checkout package_version.orig.tar.gz
    
  6. Build in chroot and upload to ftp-master as usual.
^

-- Daniel Baumann <daniel@debian.org> Sun, 27 Jan 2008 10:47:00 +0100