Translator(s): English - Indonesian


git-dpm helps maintain packages with git. For alternatives, see Package maintenance tools.

Maintaining Debian source packages in git with git-dpm

This page describes how to use git-dpm to maintain Debian source packages in a git repository. See also the manpage git-dpm(1) for more documentation.

Compatibility with gbp (git-buildpackage) and DEP-14

Please note that git-dpm is not compatible with the workflow of gbp (git-buildpackage) tools as well as the recommended Debian Enhance Proposal DEP-14: Recommended layout for Git packaging repositories. If you want to use gbp family of commands rather than git-dpm to maintain Debian source packages in a git repository, please read Packaging with Git instead.

Design goals

The main design goals are:

Documentation

How to start

You can either import .dsc files or start from scratch.

The following command will import a .dsc file and try to import it as git-dpm project:

git-dpm import-dsc --branch branchname package.dsc

If branchname does already exist, it will be added as git parent commit, otherwise a new branch will be created.

Use -p argument oo include upstream's history to the parents of the imported .orig.tar file. For example if the git repository you are in contains a tag foo-1.1 the command would look like this:

git-dpm import-dsc --branch foo-debian -p foo-1.1 ../foo_1.1-1.dsc

Common operations

Build a package

The following command will check if everything is ready (possibly checking out a missing .orig.tar file using pristine tar) and then build it:

git-dpm prepare && dpkg-buildpackage -rfakeroot -us -uc

Usually it should suffice to just place the .orig.tar file in the parent directory and call dpkg-buildpackage, but git-dpm prepare will make sure you are not in the middle of some change and the correct .orig.tar file is there.

Add a patch

To write a patch yourself:

git-dpm checkout-patched
vim files
git commit -a
git-dpm update-patches

Include a patch file:

git-dpm apply-patch patchfile
git-dpm update-patches

Cherry pick a commit from upstream:

git-dpm cherry-pick commit
git-dpm update-patches

You of course only need the update-patches command once you are done and not if you want to add more stuff or edit any of the patches afterwards.

Tricks

git config --global dpm.pristineTarCommit true

debianTag="debian/%e%v"
patchedTag="patched/%e%v"
upstreamTag="upstream/%e%u"

Shortcomings