A (git) workflow for Debian packaging

martin f krafft madduck at debian.org
Wed Oct 10 01:58:01 UTC 2007


also sprach martin f krafft <madduck at debian.org> [2007.10.09.1057 +0100]:
> This doesn't work, since octopus merging (which is what
> poor-mans-gitbuild does: git-merge with multiple branches as
> arguments) isn't as smart as I thought:
>   http://marc.info/?l=git&m=119188993817723&w=2

I fixed it buy making the build script merge branches one after the
other:

  #!/bin/sh
  set -eu
  git checkout master
  debver=$(dpkg-parsechangelog | sed -ne 's,Version: ,,p')
  git checkout build
  git merge ${1:-upstream}
  git merge upstream-patches
  git merge master
  for b in $(git for-each-ref --format='%(refname)' refs/heads/deb/*); do
    git merge $b
  done
  git tag -s debian/$debver
  debuild   # will ignore .git automatically
  git checkout master

I also added this paragraph:

  Note how we are merging each branch in turn, instead of using the
  octopus merge strategy (which would create a commit with more than
  two parents) for reasons outlined `in this post
  <http://lists.madduck.net/pipermail/vcs-pkg/2007-October/000028.html>`_.
  An octopus-merge *would actually* work in our situation, but it
  will not always work, so better safe than sorry (although you
  *could* still `achieve the same result
  <http://lists.madduck.net/pipermail/vcs-pkg/2007-October/000029.html>`_).

Obviously, the build script is shite; if a merge fails, the person
is left somewhere weird. It helps that I show how to reset build
(git checkout build; git reset --hard upstream) to be able to retry,
but it's not perfect. But this is *poor-mans*-gitbuild. There has to
be room for improvement. :)

-- 
 .''`.   martin f. krafft <madduck at debian.org>
: :'  :  proud Debian developer, author, administrator, and user
`. `'`   http://people.debian.org/~madduck - http://debiansystem.info
  `-  Debian - when you have better things to do than fixing systems
 
it has been said that there are only two businesses
that refer to customers as users:
illegal drug trade and the computer industry.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature (see http://martin-krafft.net/gpg/)
Url : http://lists.alioth.debian.org/pipermail/vcs-pkg-discuss/attachments/20071010/c595c1a5/attachment.pgp 


More information about the vcs-pkg-discuss mailing list