This package use gitpkg over quilt over git svn

[quick install]

* clone repo

git clone git+ssh://login@git.debian.org/git/collab-maint/imagemagick.git
git svn init -s --prefix=origin/  https://www.imagemagick.org/subversion/ImageMagick/
git config gitpkg.orig-compressor bzip2
git config gitpkg.deb-export-hook /usr/share/gitpkg/hooks/quilt-patches-deb-export-hook
git config gitpkg.pre-export-hook /usr/share/gitpkg/hooks/pristine-tar-pre-export-hook


* pull trunk

git checkout -f trunk
git svn fetch

* new upstream version (or use the script under debian/script under the last commited debian version)

git svn fetch #retrieve recent svn commit
git checkout 9682bf563240ad971717554bab3f69f7252767f5 # git revision for svn commit 7980 aka version 6.7.7.0
git checkout -b upstream/6.7.7.0 # create an upstream branch for revision 6.7.7.0
rm -rf * # clean up directory tree
tar --strip 1 -xaf ../imagemagick_6.7.7.0.orig.tar.bz2 # extract origin
git add . # add everything
git commit -a -m "add uptream tar.bz2"
pristine-tar commit ../imagemagick_6.7.7.0.orig.tar.bz2 upstream/6.7.7.0 # use pristine tar
git checkout -b debian-patches/6.7.7.0-1
git checkout debian/6.7.6.8-1 # checkout previous debian tree
git checkout -b  debian/6.7.7.0-1 # create new debian branch
git checkout debian/6.7.6.8-1 # checkout previous debian tree
git merge  --no-commit upstream/6.7.7.0 # merge but without commiting
find ./* -path './debian' -prune -o -path './.git' -prune -o -exec rm -rf '{}' + # remove all except debian and git
tar --strip 1 -xaf ../imagemagick_6.7.7.0.orig.tar.bz2 # use upstream
git add .
git commit -a -m 'merge with upstream' # emulate git theirs but safer

* use patch from debian branches and rebase

git checkout debian-patches/$(version -1)
git branch debian-patches/$(version)
git checkout debian-patches/$(version)
git rebase upstream/$version

* package for debian

gitpkg debian/$version upstream/$version


[gitpkg]
This is controlled by a file debian/source/git-patches. Each line contains a range suitable for passing to git-format-patch(1). 
The variables UPSTREAM_VERSION and DEB_VERSION are replaced with values taken from debian/changelog. 
Note that $UPSTREAM_VERSION is the first part of $DEB_VERSION
An example is:
 upstream/$UPSTREAM_VERSION..patches/$DEB_VERSION
 upstream/$UPSTREAM_VERSION..embedded-libs/$DEB_VERSION

This tells gitpkg to export the given two ranges of commits to debian/patches while generating the source package. 
Each commit becomes a patch in debian/patches, with names generated from the commit messages. In this example, we get 5 patches from the two ranges.
 0001-expand-pattern-in-no-java-rule.patch
 0002-fix-dd_free_global_constants.patch
 0003-Backported-patch-for-CPlusPlus-name-mangling-guesser.patch
 0004-Use-system-copy-of-nauty-in-apps-graph.patch
 0005-Comment-out-jreality-installation.patch

Thanks to the wonders of 3.0 (quilt) packages, these are applied when the source package is unpacked.

This package uses quilt to manage all modifications to the upstream
source.  Changes are stored in the source package as diffs in
debian/patches and applied during the build.

Moreinformation: man gitpkg

[quilt]
This package uses quilt to manage all modifications to the upstream
source.  Changes are stored in the source package as diffs in
debian/patches and applied during the build.

More information: /usr/share/doc/quilt/README.source

 -- Bastien Roucariès <roucaries.bastien+debian@gmail.com>, Wed, 11 Jul 2012 17:57:00 +0200
