my vcs-pkg demonstration

martin f krafft madduck at madduck.net
Thu Jun 21 17:02:20 UTC 2007


Here is the typescript I had prepared for today's demonstration of
using git for Debian packaging. Please feel free to jump in and ask
questions; this workflow is not yet finalised and I have not
actually used it much.

Note that I still use rebase in that, but I have since learnt that
it may not be a good idea because feature branches in Debian
packaging are actually public in a sense and rebase kinda
invalidates a branch in that anyone who cloned a branch that was
then rebased will not receive new commits on the rebased branch.
I am still investigating...

Now enjoy:

# import upstream
$ tar xfz gruezi_1.1.orig.tar.gz 
$ cd gruezi-1.1 
$ git init-db
Initialized empty Git repository in .git/
$ git add .
$ git commit -m'initial commit'
Created initial commit 79ab9c8: initial commit
$ git tag -m 'tagging upstream 1.1' -s upstream/1.1 
$ git branch -m master upstream

# add debian-dir branch
$ git checkout -b debian-dir
Switched to a new branch "debian-dir"
$ zcat ../gruezi_1.1-1.diff.gz | patch -p1
$ git add debian/
$ git commit -m'import of debian directory'

# debianisation
$ git checkout -b debianisation upstream
Switched to a new branch "debianisation"
$ echo "# THIS IS AN IMPORTANT DEBIAN-SPECIFIC CHANGE" >> gruezi.in
$ git commit -a -m'making an important debian-specific change'

# add feature branch
$ git checkout -b fix-bashism upstream
Switched to a new branch "fix-bashism"
$ sed -i -e 1s,/bin/sh,/bin/bash, gruezi.in
$ git commit -m'fix bashisms' gruezi.in

# integration
$ git checkout -b integration upstream
$ git merge debian-dir
$ git merge fix-bashism
$ git merge debianisation

# release
$ dpkg-buildpackage …
$ git tag -s -m 'tagging 1.1-1' debian/1.1-1
$ git tag -s -m 'tagging 1.1-1' debian-dir/1.1-1 debian-dir

# policy change
$ git checkout debianisation
Switched to branch "debianisation"
$ echo '# CHANGE REQUIRED BY POLICY' >> gruezi.in 
$ git commit -a -m'change required by policy'

$ git checkout debian-dir
$ dch -i -- policy change
$ git commit -a -m'change required by policy'

# reintegration and release
$ git checkout integration
$ git merge debianisation
$ git merge debian-dir
$ dpkg-buildpackage …
$ git tag -s -m 'tagging 1.1-2' debian/1.1-2
$ git tag -s -m 'tagging 1.1-2' debian-dir/1.1-2 debian-dir

# new upstream version, or upstream patch
# git checkout upstream
$ #patch -p1 < /patch/from/upstream.patch
$ echo new version >> ChangeLog
$ sed -i -e '5a#new feature' gruezi.in
$ git commit -m'pull in upstream 1.2' -a
$ git tag -m 'tagging upstream 1.2' -s upstream/1.2
$ git diff upstream fix-bashism #OOPS
$ git rebase upstream fix-bashism 
$ git rebase upstream debianisation
$ git rebase upstream debian-dir

# release
$ git checkout debian-dir
$ dch -v1.2-1 -- new upstream release
$ git commit -m'preparing new release' -a

# merge changes into integration
$ git checkout integration
$ git merge upstream
$ git merge debian-dir
$ dpkg-buildpackage …
$ git tag -s -m 'tagging 1.2-1' debian/1.2-1
$ git tag -s -m 'tagging 1.2-1' debian-dir/1.2-1 debian-dir

# new upstream incorporating feature branch
$ tar xfz ../gruezi_2.2.orig.tar.gz
$ mv gruezi-2.2/* . && rmdir gruezi-2.2
$ git branch #OOPS
$ git reset --hard HEAD

$ git add / git rm
$ git checkout upstream
$ tar xfz ../gruezi_2.2.orig.tar.gz
$ mv gruezi-2.2/* . && rmdir gruezi-2.2
$ git commit -m'import new upstream version' -a

$ git diff upstream fix-bashism | wc -l
0

$ git tag -m 'tagging upstream 2.0' -s upstream/2.0
$ git rebase upstream fix-bashism
Switched to branch "fix-bashism"
First, rewinding head to replay your work on top of it...
HEAD is now at da03a75... upstream has feature branch incorporated
$ git rebase upstream debianisation
$ git rebase upstream debian-dir

$ git checkout debian-dir
$ dch -v2.2-1 -- new upstream release
$ git commit -m'preparing a new release' -a

# upstream changed substantially, so new branch
$ git branch -m integration int-1.x
$ git checkout -b integ
$ git merge fix-bashism
Already up-to-date.
$ git merge debianisation
$ git merge debian-dir

$ dpkg-buildpackage …
$ git tag -s -m 'tagging 2.2-1' debian/2.2-1
$ git tag -s -m 'tagging 2.2-1' debian-dir/2.2-1 debian-dir

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net at madduck
 
spamtraps: madduck.bogus at madduck.net
 
"alas, i am dying beyond my means."
                                                        -- oscar wilde
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature (GPG/PGP)
Url : http://lists.alioth.debian.org/pipermail/vcs-pkg-discuss/attachments/20070621/556116b7/attachment.pgp 


More information about the vcs-pkg-discuss mailing list