GitImpl

Git Implementation

See NoMoreSourcePackages for more advantages and/or implementation ideas.

This implementation uses two git repositories per package. The source code itself (including ubuntu/debian specific patches) and debian/*.

A key difference of this approach is putting the patches directly with the source code. This means git can manage merges, conflicts with the patches. Upstream developers (more easily if they use git) can pull the latest ubuntu/debian version, review the changes, and then merge.

Another advantage is that the package will no longer need rules to clean, apply, or deapply patches. Currently there are many packages that fail when built twice.

Initial Conversion to a git package

apt-get source nano
dpkg-source -x nano_2.0.2-1.dsc
cd nano-2.0.2
mv debian ../
git init-db
git add .
git commit
mv ../debian .
cd debian
git init-db
git add .
git commit
#TODO: show what to do if the package has patches.

Making a change to the package's source code

#make changes

#to test run
fakeroot debian/rules build-arch
#install package, see if it works...

git update-index CHANGED FILES
git commit

#notice how you can make changes and test at the same time (it was difficult to do this previously)

#if core maintainer
git push

#if non-maintainer
git log
git diff REVA REVB
#put patch on launchpad

#if non-maintainer alternate
git push MY PERSONAL REPO
#alert maintainer about your change via launchpad

To build

fakeroot debian/rules build-arch

To clean

debian/rules clean

For debian/ubuntu to remain in sync, it will be a matter of the devs running git pull with all hard merging work done for them.

Upstream Devs

git clone URL OF SOURCE PACKAGE
git log

#if they don't use git
git diff
#merge patches

#if they use git
git cherry-pick

Bumping Packages

#if git
git pull #with version tag

#otherwise
[Download old version]
[Download new version]
[extract]
diff -Nru oldversion newversion > changeset
cd debianpackage
patch -p1 < changeset
git commit
dch -i
cd debian
git commit

gitdeb.mk

# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2007 Stephen Cook <siti@orcon.net.nz>
#
# Description: A CDBS frontend to packaging using git
#
# This program is free software; 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 2, or (at
# your option) any later version.
#
# This program 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, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
# 02111-1307 USA.

#the exclude pattern is needed for some weird reason
clean:
        git-ls-files --ignored -x \* -o --directory | grep -v debian | xargs rm -rf
        cd debian && git-ls-files --ignored -x \* -o --directory | xargs rm -rf

NoMoreSourcePackages/GitImpl (last edited 2008-08-06 16:19:11 by localhost)