Package: gitpkg
Version: 0.15
Severity: wishlist
Attached you will find a script that can run either as a hook for
gitpkg or standalone. It looks for patches in a ref based on the
Debian version (I guess a production version could allow this to be
overruled by a git config item). My workflow is
git tag -f patches/$debian-version some-branch-based-on-master
gitpkg master
then each commit on the other branch ends up as a patch in debian/patches
The advantage of using tags is that the git snapshot used to build a
package is well defined (albeit by two tags instead of 1).
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (900, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages gitpkg depends on:
ii dpkg-dev 1.15.8.5 Debian package development tools
ii git 1:1.7.2.3-2.1 fast, scalable, distributed revisi
gitpkg recommends no packages.
Versions of packages gitpkg suggests:
ii devscripts 2.10.69 scripts to make the life of a Debi
-- no debconf information
# export patches from a tag named after the Debian Version
# To use as a hook in gitpkg,
# git config gitpkg.deb-export-hook debian/export-patches.sh
PATCH_TAG=patches/$(dpkg-parsechangelog | sed -n 's/^Version:
\(.*:\|\)\(.*\)/\2/p')
export GIT_DIR
if [ -n "$REPO_DIR" ]; then
GIT_DIR=$REPO_DIR/.git
fi;
if git rev-parse ${PATCH_TAG} >/dev/null 2>&1; then
echo exporting patches from ${PATCH_TAG}
rm -rf debian/patches
PATCHES=`git format-patch -N -o debian/patches HEAD...$PATCH_TAG`
echo $PATCHES | sed -e 's%debian/patches/%%g' -e 's% %\n%g'>
debian/patches/series
else
echo No patch tag/branch ${PATCH_TAG};
fi