upstream branch and upstream tarball in git-dpm

Often the upstream branch in a git-dpm project will be an imported tar file, sometimes with upstream's history added as parent commit using import-tar's or import-dsc's -p.

But the commit recorded as upstream branch can differ, contrained by the following conditions:

advantages / disadvantages for non-verbatim upstream branch

Not importing the .orig.tar but using a upstream provided commit as upstream branch directly has the main advantage that you are nearer to upstream. If you want to use some commits made there directly after the release as patches, you do not need to cherry pick them but can just fast forward your branch. Also upstream does not need to cherry-pick your commits, but can just pull them.

But if you want only some of the following commits, you will need to cherry-pick anyway. And as the commits in the patched branch are used to make the patches in debian/patches, you will most likely want to have a different description anyway than what is in upstream's repository, so the advantage will usually be none.

The biggest disadvantages of having a upstream branch that is not exactly like the unpacked source but only similar enough is that it is hard to check everything is correct. Git-dpm has no checks to even check things and the most important things (exististance of files does not change build) are not even decideable by a computer.

Thus just importing the .orig.tar file is recommended unless you have strong reasons or feelings the other way.

examples

The easiest example is an upstream that misses some files in its VCS that are in the tarball but those files are not needed by the build. In this case you can just use that branch as upstream part (the only hard part is being sure those files are really not needed).

Second most easy is a tarball that misses files in the tarball that are in the upstream branch but are not needed for building the package. In this case just delete the files from your debian branch. You will not be able to reintroduce any of those files by a patch. And if your tarball later introduces and needs those files, don't forget to reintroduce the files in the debian branch (Unless you use import-dsc, git-dpm will keep deleted files deleted in the debian branch even when merging in a new patched branch on a new upstream branch).

If the files missing in the upstream tarball are needed for the build (usual examples are Makefile.in or configure), this only works if you regenerate them at build time (in above example by autoreconf). Don't forget to delete all the files generated by that in debian/rules clean, though.