experimental perl-topgit repository

Niko Tyni ntyni at debian.org
Sun Jan 4 17:17:52 UTC 2009


I've been playing with TopGit lately, and I now have a working
prototype for using it with the Perl packaging.

The idea is to make all changes to upstream code in separate branches and
then generate debian/patches for each release. The patch stack generated
by TopGit is primarily intended for 'quilt' consumption, but as we want
the patches applied at 'dpkg-source -x' time, we currently can't use
quilt easily. Hence I haven't touched the custom patch/unpatch system
more than was strictly necessary.

I'm hoping that dpkg v3 source formats will get accepted by the archive
after Lenny, that would make things much simpler. See #457345 and
 http://lists.debian.org/debian-devel-announce/2008/04/msg00004.html
for some background.

I didn't push the stuff to the main repository yet as it's still
experimental and I don't want to guarantee yet that the history will
stay stable. However, it can be tried out with

 apt-get install topgit

 git clone git://git.debian.org/~ntyni/perl-topgit.git
 cd perl-topgit
 git checkout -b upstream origin/upstream
 tg remote --populate origin

or, in an existing clone of the "real" perl.git repository:

 git checkout -b upstream origin/upstream
 git remote add perl-topgit git://git.debian.org/~ntyni/perl-topgit.git
 tg remote --populate perl-topgit
 git fetch
 tg update

(The local upstream branch is needed because the TopGit branches are
 based on that. I'm not quite sure if I'm doing something wrong here.)

I'd be happy to get any feedback. This feels like a big improvement
over the current manual debian/patches handling, and unless there are
objections I'll probably push this to the main repository next weekend
or so.

Quoting the new debian/README.source:

 Managing debian/patches with TopGit
 -----------------------------------
 
 This section is targeted at the Debian package maintainers, working with
 the Git repository pointed by the Vcs-Git field in debian/control.  NMUers
 and the like can use the old way of standalone patch handling described
 above, or just hack the source and ignore debian/patches altogether.
 
 First, you need to have the 'topgit' package installed. The current version
 as of this writing is 0.5-1.
 
 The TopGit procedure for applying a new patch is:
 
  tg create fixes/foo upstream # s|fixes|debian| for Debian-specific changes
  <edit .topmsg, include a meaningful Subject for 'tg summary'>
  <hack the source and commit away>
  git checkout master
  tg depend add fixes/foo
  tg update
  git-dch # or just plain dch, YMMV
 
 The procedure for tagging a new package version is (broadly):
 
  dch -r
  ./debian/rules new-build
  git tag -m 'Debian release x' debian/x
  git branch -D tmp-build
  git push --tags
 
 Note that this will create a 'detached' tag: we don't need a long-lived
 build branch as debian/patches is regenerated every time.
 
 Retiring a source fix (for instance because upstream used a different
 implementation):
 
  git checkout fixes/obsolete
  tg patch | patch -Rp1 # generate a 'revert commit'
  git commit -m 'Revert to upstream fix' # please elaborate
  git checkout master
  tg update
  sed -i '/obsolete/ d' .topdeps # until 'tg depend remove' gets implemented
  git commit -m 'retire fixes/obsolete' .topdeps
  tg delete fixes/obsolete
 
-- 
Niko Tyni   ntyni at debian.org 



More information about the Perl-maintainers mailing list