<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dw="https://www.dreamwidth.org">
  <id>tag:dreamwidth.org,2009-05-21:377446</id>
  <title>Ian Jackson</title>
  <subtitle>Ian Jackson</subtitle>
  <author>
    <name>Ian Jackson</name>
  </author>
  <link rel="alternate" type="text/html" href="https://diziet.dreamwidth.org/"/>
  <link rel="self" type="text/xml" href="https://diziet.dreamwidth.org/data/atom"/>
  <updated>2026-03-05T18:47:55Z</updated>
  <dw:journal username="diziet" type="personal"/>
  <entry>
    <id>tag:dreamwidth.org,2009-05-21:377446:20851</id>
    <link rel="alternate" type="text/html" href="https://diziet.dreamwidth.org/20851.html"/>
    <link rel="self" type="text/xml" href="https://diziet.dreamwidth.org/data/atom/?itemid=20851"/>
    <title>Adopting tag2upload and modernising your Debian packaging</title>
    <published>2026-02-15T13:30:42Z</published>
    <updated>2026-03-05T18:47:55Z</updated>
    <category term="debian"/>
    <category term="dgit"/>
    <category term="tag2upload"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">&lt;div style="background-color: #fff; color: #000"&gt;
&lt;h1&gt;&lt;a name="introduction"&gt;Introduction&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://wiki.debian.org/tag2upload"&gt;tag2upload&lt;/a&gt; allows authorised Debian contributors to upload to Debian simply by pushing a signed git tag to Debian&amp;rsquo;s gitlab instance, Salsa.
&lt;p&gt;We have recently &lt;a href="https://lists.debian.org/debian-devel-announce/2026/02/msg00002.html"&gt;announced&lt;/a&gt; that tag2upload is, in our opinion, now very stable, and ready for general use by all Debian uploaders.
&lt;p&gt;tag2upload, as part of &lt;a href="https://diziet.dreamwidth.org/20436.html"&gt;Debian&amp;rsquo;s git transition programme&lt;/a&gt;, is very flexible - it needs to support a large variety of maintainer practices. And it&amp;rsquo;s relatively unopinionated, wherever that&amp;rsquo;s possible. But, during the open beta, various contributors emailed us asking for Debian packaging git workflow advice and recommendations.
&lt;p&gt;This post is an attempt to give some more opinionated answers, and guide you through modernising your workflow.
&lt;p&gt;(This article is aimed squarely at Debian contributors. Much of it will make little sense to Debian outsiders.)
&lt;ul&gt;&lt;li&gt;&lt;a href="#why"&gt;Why&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="#ease-of-development"&gt;Ease of development&lt;/a&gt;
&lt;li&gt;&lt;a href="#dont-fear-a-learning-burden-instead-start-forgetting-all-that-nonsense"&gt;Don&amp;rsquo;t fear a learning burden; instead, start forgetting all that nonsense&lt;/a&gt;
&lt;li&gt;&lt;a href="#properly-publishing-the-source-code"&gt;Properly publishing the source code&lt;/a&gt;
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;li&gt;&lt;a href="#adopting-tag2upload---the-minimal-change"&gt;Adopting tag2upload - the minimal change&lt;/a&gt;
&lt;li&gt;&lt;a href="#overhauling-your-workflow-using-advanced-git-first-tooling"&gt;Overhauling your workflow, using advanced git-first tooling&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="#assumptions"&gt;Assumptions&lt;/a&gt;
&lt;li&gt;&lt;a href="#topics-and-tooling"&gt;Topics and tooling&lt;/a&gt;
&lt;li&gt;&lt;a href="#choosing-the-git-branch-format"&gt;Choosing the git branch format&lt;/a&gt;
&lt;li&gt;&lt;a href="#determine-upstream-git-and-stop-using-upstream-tarballs"&gt;Determine upstream git and stop using upstream tarballs&lt;/a&gt;
&lt;li&gt;&lt;a href="#convert-the-git-branch"&gt;Convert the git branch&lt;/a&gt;
&lt;li&gt;&lt;a href="#change-the-source-format"&gt;Change the source format&lt;/a&gt;
&lt;li&gt;&lt;a href="#sort-out-the-documentation-and-metadata"&gt;Sort out the documentation and metadata&lt;/a&gt;
&lt;li&gt;&lt;a href="#configure-salsa-merge-requests"&gt;Configure Salsa Merge Requests&lt;/a&gt;
&lt;li&gt;&lt;a href="#set-up-salsa-ci-and-use-it-to-block-merges-of-bad-changes"&gt;Set up Salsa CI, and use it to block merges of bad changes&lt;/a&gt;
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;li&gt;&lt;a href="#day-to-day-work"&gt;Day-to-day work&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="#making-changes-to-the-package"&gt;Making changes to the package&lt;/a&gt;
&lt;li&gt;&lt;a href="#test-build"&gt;Test build&lt;/a&gt;
&lt;li&gt;&lt;a href="#uploading-to-debian"&gt;Uploading to Debian&lt;/a&gt;
&lt;li&gt;&lt;a href="#uploading-a-new-package-to-debian"&gt;Uploading a NEW package to Debian&lt;/a&gt;
&lt;li&gt;&lt;a href="#new-upstream-version"&gt;New upstream version&lt;/a&gt;
&lt;li&gt;&lt;a href="#sponsorship"&gt;Sponsorship&lt;/a&gt;
&lt;li&gt;&lt;a href="#incorporating-an-nmu"&gt;Incorporating an NMU&lt;/a&gt;
&lt;li&gt;&lt;a href="#dfsg-filtering-handling-non-free-files"&gt;DFSG filtering (handling non-free files)&lt;/a&gt;
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;li&gt;&lt;a href="#common-issues"&gt;Common issues&lt;/a&gt;
&lt;li&gt;&lt;a href="#further-reading"&gt;Further reading&lt;/a&gt;
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;a name="cutid1"&gt;&lt;/a&gt;
&lt;h1&gt;&lt;a name="why"&gt;Why&lt;/a&gt;&lt;/h1&gt;
&lt;h2&gt;&lt;a name="ease-of-development"&gt;Ease of development&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;git offers a far superior development experience to patches and tarballs. Moving tasks from a tarballs and patches representation to a normal, git-first, representation, makes everything simpler.
&lt;p&gt;dgit and tag2upload do automatically many things that have to be done manually, or with separate commands, in dput-based upload workflows.
&lt;p&gt;They will also save you from a variety of common mistakes. For example, you cannot accidentally overwrite an NMU, with tag2upload or dgit. These many safety catches mean that our software sometimes complains about things, or needs confirmation, when more primitive tooling just goes ahead. We think this is the right tradeoff: it&amp;rsquo;s part of the great care we take to avoid our software making messes. Software that has your back is very liberating for the user.
&lt;p&gt;tag2upload makes it possible to upload with very small amounts of data transfer, which is great in slow or unreliable network environments. The other week I did a git-debpush over mobile data while on a train in Switzerland; it completed in seconds.
&lt;p&gt;See the &lt;a href="#day-to-day-work"&gt;Day-to-day work section&lt;/a&gt; below to see how simple your life could be.
&lt;h2&gt;&lt;a name="dont-fear-a-learning-burden-instead-start-forgetting-all-that-nonsense"&gt;Don&amp;rsquo;t fear a learning burden; instead, start forgetting all that nonsense&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Most Debian contributors have spent months or years learning how to work with Debian&amp;rsquo;s tooling. You may reasonably fear that our software is yet more bizarre, janky, and mistake-prone stuff to learn.
&lt;p&gt;We promise (and our users tell us) that&amp;rsquo;s not how it is. We have spent a lot of effort on providing a good user experience. Our new git-first tooling, especially dgit and tag2upload, is much simpler to use than source-package-based tooling, despite being more capable.
&lt;p&gt;The idiosyncrasies and bugs of source packages, and of the legacy archive, have been relentlessly worked around and papered over by our thousands of lines of thoroughly-tested defensive code. You too can forget all those confusing details, like our users have! After using our systems for a while you won&amp;rsquo;t look back.
&lt;p&gt;And, you shouldn&amp;rsquo;t fear trying it out. dgit and tag2upload are unlikely to make a mess. If something is wrong (or even doubtful), they will typically detect it, and stop. This does mean that starting to use tag2upload or dgit can involve resolving anomalies that previous tooling ignored, or passing additional options to reassure the system about your intentions. So admittedly it &lt;em&gt;isn&amp;rsquo;t&lt;/em&gt; always trivial to get your first push to succeed.
&lt;h2&gt;&lt;a name="properly-publishing-the-source-code"&gt;Properly publishing the source code&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;One of Debian&amp;rsquo;s foundational principles is that we publish the source code.
&lt;p&gt;Nowadays, the vast majority of us, and of our upstreams, are using git. We are doing this because git makes our life so much easier.
&lt;p&gt;But, without tag2upload or dgit, we aren&amp;rsquo;t &lt;em&gt;properly&lt;/em&gt; publishing our work! Yes, we typically put our git branch on Salsa, and point &lt;code&gt;Vcs-Git&lt;/code&gt; at it. However:
&lt;ul&gt;&lt;li&gt;The format of git branches on Salsa is not standardised. They might be patches-unapplied, patches-applied, bare &lt;code&gt;debian/&lt;/code&gt;, or &lt;a href="https://wiki.debian.org/GitPackagingSurvey"&gt;something even stranger&lt;/a&gt;.
&lt;li&gt;There is no guarantee that the DEP-14 &lt;code&gt;debian/1.2.3-7&lt;/code&gt; tag on salsa corresponds precisely to what was actually uploaded. dput-based tooling (such as &lt;code&gt;gbp buildpackage&lt;/code&gt;) doesn&amp;rsquo;t cross-check the .dsc against git.
&lt;li&gt;There is no guarantee that the presence of a DEP-14 tag even means that that version of package is in the archive.
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;This means that the git repositories on Salsa cannot be used by anyone who needs things that are &lt;em&gt;systematic&lt;/em&gt; and &lt;em&gt;always correct&lt;/em&gt;. They are OK for expert humans, but they are awkward (even &lt;a href="https://diziet.dreamwidth.org/9556.html"&gt;hazardous&lt;/a&gt;) for Debian novices, and you cannot use them in automation. The real test is: could you use &lt;code&gt;Vcs-Git&lt;/code&gt; and Salsa to build a Debian derivative? You could not.
&lt;p&gt;tag2upload and dgit &lt;em&gt;do&lt;/em&gt; solve this problem. When you upload, they:
&lt;ol type="1"&gt;&lt;li&gt;Make a canonical-form (patches-applied) derivative of your git branch;
&lt;li&gt;Ensure that there is a well-defined correspondence between the git tree and the source package;
&lt;li&gt;Publish both the DEP-14 tag and a canonical-form &lt;code&gt;archive/debian/1.2.3-7&lt;/code&gt; tag to a single central git depository, &lt;a href="https://browse.dgit.debian.org"&gt;&lt;code&gt;*.dgit.debian.org&lt;/code&gt;&lt;/a&gt;;
&lt;li&gt;Record the git information in the &lt;code&gt;Dgit&lt;/code&gt; field in &lt;code&gt;.dsc&lt;/code&gt; so that clients can tell (using the &lt;a href="https://ftp-team.pages.debian.net/dak/docs/generated/dakweb.html#module-dakweb"&gt;ftpmaster API&lt;/a&gt;) that this was a git-based upload, what the corresponding git objects are, and where to find them.
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;This dependably conveys your git history to users and downstreams, in a standard, systematic and discoverable way. tag2upload and dgit are the only system which achieves this.
&lt;p&gt;(The client is &lt;code&gt;dgit clone&lt;/code&gt;, as advertised in e.g. &lt;a href="https://manpages.debian.org/testing/dgit/dgit-user.7.en.html"&gt;dgit-user(7)&lt;/a&gt;. For dput-based uploads, it falls back to importing the source package.)
&lt;h1&gt;&lt;a name="adopting-tag2upload---the-minimal-change"&gt;Adopting tag2upload - the minimal change&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;tag2upload is a substantial incremental improvement to many existing workflows. git-debpush is a drop-in replacement for building, signing, and uploading the source package.
&lt;p&gt;So, you can just adopt it &lt;em&gt;without&lt;/em&gt; completely overhauling your packaging practices. You and your co-maintainers can even mix-and-match tag2upload, dgit, and traditional approaches, for the same package.
&lt;p&gt;Start with &lt;a href="https://wiki.debian.org/tag2upload"&gt;the wiki page&lt;/a&gt; and &lt;a href="https://manpages.debian.org/testing/git-debpush/git-debpush.1.en.html"&gt;git-debpush(1)&lt;/a&gt; (ideally from forky aka testing).
&lt;p&gt;&lt;strong&gt;You &lt;em&gt;don&amp;rsquo;t&lt;/em&gt; need to do any of the other things recommended in this article.&lt;/strong&gt;
&lt;h1&gt;&lt;a name="overhauling-your-workflow-using-advanced-git-first-tooling"&gt;Overhauling your workflow, using advanced git-first tooling&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;The rest of this article is a guide to adopting the best and most advanced git-based tooling for Debian packaging.
&lt;h2&gt;&lt;a name="assumptions"&gt;Assumptions&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;&lt;p&gt;Your current approach uses the &amp;ldquo;patches-unapplied&amp;rdquo; git branch format used with &lt;code&gt;gbp pq&lt;/code&gt; and/or &lt;code&gt;quilt&lt;/code&gt;, and often used with &lt;code&gt;git-buildpackage&lt;/code&gt;. You previously used &lt;code&gt;gbp import-orig&lt;/code&gt;.

&lt;li&gt;&lt;p&gt;You are fluent with git, and know how to use Merge Requests on gitlab (Salsa). You have your &lt;code&gt;origin&lt;/code&gt; remote set to Salsa.

&lt;li&gt;&lt;p&gt;Your main Debian branch name on Salsa is &lt;code&gt;master&lt;/code&gt;. Personally I &lt;a href="https://datatracker.ietf.org/doc/statement-iab-statement-on-inclusive-language-in-iab-stream-documents/"&gt;think we should use &lt;code&gt;main&lt;/code&gt;&lt;/a&gt; but changing your main branch name is outside the scope of this article.

&lt;li&gt;&lt;p&gt;You have enough familiarity with Debian packaging including concepts like source and binary packages, and NEW review.

&lt;li&gt;&lt;p&gt;Your co-maintainers are also adopting the new approach.

&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;tag2upload and dgit (and git-debrebase) are flexible tools and can help with many other scenarios too, and you can often mix-and-match different approaches. But, explaining every possibility would make this post far too confusing.
&lt;h2&gt;&lt;a name="topics-and-tooling"&gt;Topics and tooling&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;This article will guide you in adopting:
&lt;ul&gt;&lt;li&gt;tag2upload
&lt;li&gt;Patches-applied git branch for your packaging
&lt;li&gt;Either plain git merge or git-debrebase
&lt;li&gt;dgit when a with-binaries uploaded is needed (NEW)
&lt;li&gt;git-based sponsorship
&lt;li&gt;Salsa (gitlab), including Debian Salsa CI
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;h2&gt;&lt;a name="choosing-the-git-branch-format"&gt;Choosing the git branch format&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;In Debian we need to be able to modify the upstream-provided source code. Those modifications are the &lt;strong&gt;Debian delta&lt;/strong&gt;. We need to somehow represent it in git.
&lt;p&gt;We recommend storing the delta &lt;em&gt;as git commits to those upstream files&lt;/em&gt;, by picking one of the following two approaches.
&lt;blockquote style="background-color: #eee; color: #222; font-style: italic;"&gt;
&lt;h6 style="margin-bottom: 0;"&gt;rationale&lt;/h6&gt;

&lt;p&gt;Much traditional Debian tooling like &lt;code&gt;quilt&lt;/code&gt; and &lt;code&gt;gbp pq&lt;/code&gt; uses the &amp;ldquo;patches-unapplied&amp;rdquo; branch format, which stores the delta as patch files in &lt;code&gt;debian/patches/&lt;/code&gt;, in a git tree full of unmodified upstream files. This is clumsy to work with, and can even be an &lt;a href="https://diziet.dreamwidth.org/9556.html"&gt;alarming beartrap&lt;/a&gt; for Debian outsiders.
&lt;/p&gt;&lt;/blockquote&gt;

&lt;div style="background-color: #ddf; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git merge&lt;/h5&gt;

&lt;p&gt;&lt;strong&gt;Option 1: simply use git, directly, including git merge.&lt;/strong&gt;
&lt;p&gt;Just make changes directly to upstream files on your Debian branch, when necessary. Use plain &lt;code&gt;git merge&lt;/code&gt; when merging from upstream.
&lt;p&gt;This is appropriate if your package has no or very few upstream changes. It is a good approach if the Debian maintainers and upstream maintainers work very closely, so that any needed changes for Debian are upstreamed quickly, and any desired behavioural differences can be arranged by configuration controlled from within &lt;code&gt;debian/&lt;/code&gt;.
&lt;p&gt;This is the approach documented more fully in our workflow tutorial &lt;a href="https://manpages.debian.org/testing/dgit/dgit-maint-merge.7.en.html"&gt;dgit-maint-merge(7)&lt;/a&gt;.
&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;
&lt;div style="background-color: #ffa; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git-debrebase&lt;/h5&gt;

&lt;p&gt;&lt;strong&gt;Option 2: Adopt git-debrebase.&lt;/strong&gt;
&lt;p&gt;git-debrebase helps maintain your delta as linear series of commits (very like a &amp;ldquo;topic branch&amp;rdquo; in git terminology). The delta can be reorganised, edited, and rebased. git-debrebase is designed to help you carry a significant and complicated delta series.
&lt;p&gt;The older versions of the Debian delta are preserved in the history. git-debrebase makes extra merges to make a fast-forwarding history out of the successive versions of the delta queue branch.
&lt;p&gt;This is the approach documented more fully in our workflow tutorial &lt;a href="https://manpages.debian.org/testing/dgit/dgit-maint-debrebase.7.en.html"&gt;dgit-maint-debrebase(7)&lt;/a&gt;.
&lt;p&gt;Examples of complex packages using this approach include &lt;a href="https://salsa.debian.org/xen-team/debian-xen"&gt;src:xen&lt;/a&gt; and &lt;a href="https://salsa.debian.org/common-lisp-team/sbcl"&gt;src:sbcl&lt;/a&gt;.
&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;
&lt;h5&gt;&lt;/h5&gt;

&lt;h2&gt;&lt;a name="determine-upstream-git-and-stop-using-upstream-tarballs"&gt;Determine upstream git and stop using upstream tarballs&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;We recommend using upstream git, only and directly. You should ignore upstream tarballs completely.
&lt;blockquote style="background-color: #eee; color: #222; font-style: italic;"&gt;
&lt;h6 style="margin-bottom: 0;"&gt;rationale&lt;/h6&gt;

&lt;p&gt;Many maintainers have been importing upstream tarballs into git, for example by using &lt;code&gt;gbp import-orig&lt;/code&gt;. But in reality the upstream tarball is an intermediate build product, not (just) source code. Using tarballs rather than git exposes us to additional supply chain attacks; indeed, the key activation part of the xz backdoor attack was hidden only in the tarball!
&lt;p&gt;git offers better traceability than so-called &amp;ldquo;pristine&amp;rdquo; upstream tarballs. (The word &amp;ldquo;pristine&amp;rdquo; is even a &lt;a href="https://joeyh.name/blog/entry/upstream_git_repositories/"&gt;joke&lt;/a&gt; by the author of pristine-tar!)
&lt;/p&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;First, establish which upstream git tag corresponds to the version currently in Debian. From the sake of readability, I&amp;rsquo;m going to pretend that upstream version is &lt;code&gt;1.2.3&lt;/code&gt;, and that upstream tagged it &lt;code&gt;v1.2.3&lt;/code&gt;.
&lt;p&gt;Edit &lt;code&gt;debian/watch&lt;/code&gt; to contain something like this:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;version=4
opts=&amp;quot;mode=git&amp;quot; https://codeberg.org/team/package refs/tags/v(\d\S*)&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You may need to adjust the regexp, depending on your upstream&amp;rsquo;s tag name convention. If &lt;code&gt;debian/watch&lt;/code&gt; had a &lt;code&gt;files-excluded&lt;/code&gt;, you&amp;rsquo;ll need to make a &lt;a href="#dfsg-filtering-handling-non-free-files"&gt;filtered version of upstream git&lt;/a&gt;.
&lt;div style="background-color: #ffa; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git-debrebase&lt;/h5&gt;

&lt;p&gt;From now on we&amp;rsquo;ll generate our own .orig tarballs directly from git.
&lt;blockquote style="background-color: #ee9; color: #222; font-style: italic;"&gt;
&lt;h6 style="margin-bottom: 0;"&gt;rationale&lt;/h6&gt;

&lt;p&gt;We need &lt;em&gt;some&lt;/em&gt; &amp;ldquo;upstream tarball&amp;rdquo; for the &lt;code&gt;3.0 (quilt)&lt;/code&gt; source format to work with. It needs to correspond to the git commit we&amp;rsquo;re using as our upstream. We &lt;em&gt;don&amp;rsquo;t&lt;/em&gt; need or want to use a tarball from upstream for this. The &lt;code&gt;.orig&lt;/code&gt; is just needed so a nice legacy Debian source package (&lt;code&gt;.dsc&lt;/code&gt;) can be generated.
&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Probably, the current &lt;code&gt;.orig&lt;/code&gt; in the Debian archive, is an upstream tarball, which may be different to the output of git-archive and possibly even have different contents to what&amp;rsquo;s in git. The legacy archive has trouble with differing &lt;code&gt;.orig&lt;/code&gt;s for the &amp;ldquo;same upstream version&amp;rdquo;.
&lt;p&gt;So we must &amp;mdash; until the next upstream release &amp;mdash; change our idea of the upstream version number. We&amp;rsquo;re going to add &lt;code&gt;+git&lt;/code&gt; to Debian&amp;rsquo;s idea of the upstream version. Manually make a tag with that name:
&lt;pre class="shell-script"&gt;&lt;code&gt;git tag -m &amp;quot;Compatibility tag for orig transition&amp;quot; v1.2.3+git v1.2.3~0
git push origin v1.2.3+git&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you are doing the packaging overhaul at the same time as a new upstream version, you can skip this part.
&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;
&lt;h5&gt;&lt;/h5&gt;

&lt;h2&gt;&lt;a name="convert-the-git-branch"&gt;Convert the git branch&lt;/a&gt;&lt;/h2&gt;
&lt;div style="background-color: #ddf; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git merge&lt;/h5&gt;

&lt;p&gt;Prepare a new branch on top of upstream git, containing what we want:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;git branch -f old-master         # make a note of the old git representation
git reset --hard v1.2.3          # go back to the real upstream git tag
git checkout old-master :debian  # take debian/* from old-master
git commit -m &amp;quot;Re-import Debian packaging on top of upstream git&amp;quot;
git merge --allow-unrelated-histories -s ours -m &amp;quot;Make fast forward from tarball-based history&amp;quot; old-master
git branch -d old-master         # it&amp;#39;s incorporated in our history now&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;If there are any patches, manually apply them&lt;/strong&gt; to your &lt;code&gt;main&lt;/code&gt; branch with &lt;code&gt;git am&lt;/code&gt;, and delete the patch files (&lt;code&gt;git rm -r debian/patches&lt;/code&gt;, and commit). (If you&amp;rsquo;ve chosen this workflow, there should be hardly any patches,)
&lt;blockquote style="background-color: #cce; color: #222; font-style: italic;"&gt;
&lt;h6 style="margin-bottom: 0;"&gt;rationale&lt;/h6&gt;

&lt;p&gt;These are some pretty nasty git runes, indeed. They&amp;rsquo;re needed because we want to restart our Debian packaging on top of a possibly quite different notion of what the upstream is.
&lt;/p&gt;&lt;/blockquote&gt;

&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;
&lt;div style="background-color: #ffa; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git-debrebase&lt;/h5&gt;

&lt;p&gt;Convert the branch to git-debrebase format and rebase onto the upstream git:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;git-debrebase -fdiverged convert-from-gbp upstream/1.2.3
git-debrebase -fdiverged -fupstream-not-ff new-upstream 1.2.3+git&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you had patches which patched generated files which are present only in the upstream tarball, and not in upstream git, you will encounter rebase conflicts. You can drop hunks editing those files, since those files are no longer going to be part of your view of the upstream source code at all.
&lt;blockquote style="background-color: #ee9; color: #222; font-style: italic;"&gt;
&lt;h6 style="margin-bottom: 0;"&gt;rationale&lt;/h6&gt;

&lt;p&gt;The force option &lt;code&gt;-fupstream-not-ff&lt;/code&gt; will be needed this one time because your existing Debian packaging history is (probably) not based directly on the upstream history. &lt;code&gt;-fdiverged&lt;/code&gt; may be needed because git-debrebase might spot that your branch is not based on dgit-ish git history.
&lt;/p&gt;&lt;/blockquote&gt;

&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;
&lt;h5&gt;&lt;/h5&gt;

&lt;p&gt;Manually make your history fast forward from the git import of your previous upload.
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;dgit fetch
git show dgit/dgit/sid:debian/changelog
# check that you have the same version number
git merge -s ours --allow-unrelated-histories -m &amp;#39;Declare fast forward from pre-git-based history&amp;#39; dgit/dgit/sid&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;&lt;a name="change-the-source-format"&gt;Change the source format&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Delete any existing &lt;code&gt;debian/source/options&lt;/code&gt; and/or &lt;code&gt;debian/source/local-options&lt;/code&gt;.
&lt;div style="background-color: #ddf; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git merge&lt;/h5&gt;

&lt;p&gt;Change &lt;code&gt;debian/source/format&lt;/code&gt; to &lt;code&gt;1.0&lt;/code&gt;. Add &lt;code&gt;debian/source/options&lt;/code&gt; containing &lt;code&gt;-sn&lt;/code&gt;.
&lt;blockquote style="background-color: #cce; color: #222; font-style: italic;"&gt;
&lt;h6 style="margin-bottom: 0;"&gt;rationale&lt;/h6&gt;

&lt;p&gt;We are using the &amp;ldquo;1.0 native&amp;rdquo; source format. This is the simplest possible source format - just a tarball. We would prefer &amp;ldquo;3.0 (native)&amp;rdquo;, which has some advantages, but dpkg-source between 2013 (wheezy) and 2025 (trixie) inclusive &lt;a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=737634#107"&gt;unjustifiably rejects&lt;/a&gt; this configuration.
&lt;p&gt;You may receive bug reports from over-zealous folks complaining about the use of the 1.0 source format. You should close such reports, with a reference to this article and to &lt;a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1106402"&gt;#1106402&lt;/a&gt;.
&lt;/p&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;/p&gt;&lt;/div&gt;
&lt;div style="background-color: #ffa; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git-debrebase&lt;/h5&gt;

&lt;p&gt;Ensure that &lt;code&gt;debian/source/format&lt;/code&gt; contains &lt;code&gt;3.0 (quilt)&lt;/code&gt;.
&lt;/p&gt;&lt;/div&gt;
&lt;h5&gt;&lt;/h5&gt;

&lt;p&gt;Now you are ready to do a &lt;a href="#test-build"&gt;local test build&lt;/a&gt;.
&lt;h2&gt;&lt;a name="sort-out-the-documentation-and-metadata"&gt;Sort out the documentation and metadata&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Edit &lt;code&gt;README.source&lt;/code&gt; to at least mention dgit-maint-merge(7) or dgit-maint-debrebase(7), and to tell people not to try to edit or create anything in &lt;code&gt;debian/patches/&lt;/code&gt;. Consider saying that uploads should be done via dgit or tag2upload.
&lt;p&gt;Check that your &lt;code&gt;Vcs-Git&lt;/code&gt; is correct in &lt;code&gt;debian/control&lt;/code&gt;. Consider deleting or pruning &lt;code&gt;debian/gbp.conf&lt;/code&gt;, since it isn&amp;rsquo;t used by dgit, tag2upload, or git-debrebase.
&lt;div style="background-color: #ddf; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git merge&lt;/h5&gt;

&lt;p&gt;Add a note to &lt;code&gt;debian/changelog&lt;/code&gt; about the git packaging change.
&lt;/p&gt;&lt;/div&gt;
&lt;div style="background-color: #ffa; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git-debrebase&lt;/h5&gt;

&lt;p&gt;&lt;code&gt;git-debrebase new-upstream&lt;/code&gt; will have added a &amp;ldquo;new upstream version&amp;rdquo; stanza to &lt;code&gt;debian/changelog&lt;/code&gt;. Edit that so that it instead describes the packaging change. (Don&amp;rsquo;t remove the &lt;code&gt;+git&lt;/code&gt; from the upstream version number there!)
&lt;/p&gt;&lt;/div&gt;
&lt;h5&gt;&lt;/h5&gt;

&lt;h2&gt;&lt;a name="configure-salsa-merge-requests"&gt;Configure Salsa Merge Requests&lt;/a&gt;&lt;/h2&gt;
&lt;div style="background-color: #ffa; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git-debrebase&lt;/h5&gt;

&lt;p&gt;In &amp;ldquo;Settings&amp;rdquo; / &amp;ldquo;Merge requests&amp;rdquo;, change &amp;ldquo;Squash commits when merging&amp;rdquo; to &amp;ldquo;Do not allow&amp;rdquo;.
&lt;blockquote style="background-color: #ee9; color: #222; font-style: italic;"&gt;
&lt;h6 style="margin-bottom: 0;"&gt;rationale&lt;/h6&gt;

&lt;p&gt;Squashing could destroy your carefully-curated delta queue. It would also disrupt git-debrebase&amp;rsquo;s git branch structure.
&lt;/p&gt;&lt;/blockquote&gt;

&lt;/p&gt;&lt;/div&gt;
&lt;h5&gt;&lt;/h5&gt;

&lt;h2&gt;&lt;a name="set-up-salsa-ci-and-use-it-to-block-merges-of-bad-changes"&gt;Set up Salsa CI, and use it to block merges of bad changes&lt;/a&gt;&lt;/h2&gt;
&lt;h3&gt;&lt;a name="caveat---the-tradeoff"&gt;Caveat - the tradeoff&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;gitlab is a giant pile of enterprise crap. It &lt;a href="https://gitlab.com/gitlab-org/gitlab/-/issues/429516"&gt;is&lt;/a&gt; &lt;a href="https://gitlab.com/gitlab-org/gitlab/-/issues/472646"&gt;full&lt;/a&gt; &lt;a href="https://gitlab.com/gitlab-org/gitlab/-/issues/581752"&gt;of&lt;/a&gt; &lt;a href="https://gitlab.com/gitlab-org/gitlab/-/issues/581897"&gt;startling&lt;/a&gt; &lt;a href="https://gitlab.com/gitlab-org/gitlab/-/issues/217231"&gt;bugs&lt;/a&gt;, many of which reveal a fundamentally broken design. It is only barely Free Software in practice for Debian (in the sense that we are very reluctant to try to modify it). The constant-churn development approach and open-core business model are &lt;a href="https://mako.cc/writing/hill-free_tools.html"&gt;serious problems&lt;/a&gt;. It&amp;rsquo;s very slow (and resource-intensive). It can be depressingly unreliable. That Salsa works as well as it does is a testament to the dedication of the Debian Salsa team (and those who support them, including DSA).
&lt;p&gt;However, I have found that despite these problems, Salsa CI is well worth the trouble. Yes, there are frustrating days when work is blocked because gitlab CI is broken and/or one has to keep mashing &amp;ldquo;Retry&amp;rdquo;. But, the upside is no longer having to remember to run tests, track which of my multiple dev branches tests have passed on, and so on. Automatic tests on Merge Requests are a great way of reducing maintainer review burden for external contributions, and helping uphold quality norms within a team. They&amp;rsquo;re a great boon for the lazy solo programmer.
&lt;p&gt;The bottom line is that I absolutely love it when the computer thoroughly checks my work. This is tremendously freeing, precisely at the point when one most needs it &amp;mdash; deep in the code. If the price is to occasionally be blocked by a confused (or broken) computer, so be it.
&lt;h3&gt;&lt;a name="setup-procedure"&gt;Setup procedure&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Create &lt;code&gt;debian/salsa-ci.yml&lt;/code&gt; containing
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;include:
  - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/recipes/debian.yml&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In your Salsa repository, under &amp;ldquo;Settings&amp;rdquo; / &amp;ldquo;CI/CD&amp;rdquo;, expand &amp;ldquo;General Pipelines&amp;rdquo; and set &amp;ldquo;CI/CD configuration file&amp;rdquo; to &lt;code&gt;debian/salsa-ci.yml&lt;/code&gt;.
&lt;blockquote style="background-color: #eee; color: #222; font-style: italic;"&gt;
&lt;h6 style="margin-bottom: 0;"&gt;rationale&lt;/h6&gt;

&lt;p&gt;Your project may have an upstream CI config in &lt;code&gt;.gitlab-ci.yml&lt;/code&gt;. But you probably want to run the Debian Salsa CI jobs.
&lt;p&gt;You can add various extra configuration to &lt;code&gt;debian/salsa-ci.yml&lt;/code&gt; to customise it. Consult the &lt;a href="https://salsa.debian.org/salsa-ci-team/pipeline/-/blob/master/README.md?ref_type=heads"&gt;Salsa CI docs&lt;/a&gt;.
&lt;/p&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;div style="background-color: #ffa; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git-debrebase&lt;/h5&gt;

&lt;p&gt;Add to &lt;code&gt;debian/salsa-ci.yml&lt;/code&gt;:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;.git-debrebase-prepare: &amp;amp;git-debrebase-prepare
  # install the tools we&amp;#39;ll need
  - apt-get update
  - apt-get --yes install git-debrebase git-debpush
  # git-debrebase needs git user setup
  - git config user.email &amp;quot;salsa-ci@invalid.invalid&amp;quot;
  - git config user.name &amp;quot;salsa-ci&amp;quot;
  # run git-debrebase make-patches
  # https://salsa.debian.org/salsa-ci-team/pipeline/-/issues/371
  - git-debrebase --force
  - git-debrebase --noop-ok make-patches
  # make an orig tarball using the upstream tag, not a gbp upstream/ tag
  # https://salsa.debian.org/salsa-ci-team/pipeline/-/issues/541
  - git-deborig

.build-definition: &amp;amp;build-definition
  extends: .build-definition-common
  before_script: *git-debrebase-prepare

build source:
  extends: .build-source-only
  before_script: *git-debrebase-prepare

variables:
  # disable shallow cloning of git repository. This is needed for git-debrebase
  GIT_DEPTH: 0&lt;/code&gt;&lt;/pre&gt;&lt;blockquote style="background-color: #ee9; color: #222; font-style: italic;"&gt;
&lt;h6 style="margin-bottom: 0;"&gt;rationale&lt;/h6&gt;

&lt;p&gt;Unfortunately the Salsa CI pipeline currently lacks proper support for git-debrebase (&lt;a href="https://salsa.debian.org/salsa-ci-team/pipeline/-/issues/371"&gt;salsa-ci#371&lt;/a&gt;) and has trouble directly using upstream git for orig tarballs (&lt;a href="https://salsa.debian.org/salsa-ci-team/pipeline/-/issues/541"&gt;#salsa-ci#541&lt;/a&gt;).
&lt;p&gt;These runes were based on those &lt;a href="https://salsa.debian.org/xen-team/debian-xen/-/blob/master/debian/salsa-ci.yml?ref_type=heads"&gt;in the Xen package&lt;/a&gt;. You should subscribe to the tickets #371 and #541 so that you can replace the clone-and-hack when proper support is merged.
&lt;/p&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;/p&gt;&lt;/div&gt;
&lt;h5&gt;&lt;/h5&gt;

&lt;p&gt;Push this to salsa and make the CI pass.
&lt;p&gt;If you configured the pipeline filename after your last push, you will need to explicitly start the first CI run. That&amp;rsquo;s in &amp;ldquo;Pipelines&amp;rdquo;: press &amp;ldquo;New pipeline&amp;rdquo; in the top right. The defaults will very probably be correct.
&lt;h3&gt;&lt;a name="block-untested-pushes-preventing-regressions"&gt;Block untested pushes, preventing regressions&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In your project on Salsa, go into &amp;ldquo;Settings&amp;rdquo; / &amp;ldquo;Repository&amp;rdquo;. In the section &amp;ldquo;Branch rules&amp;rdquo;, use &amp;ldquo;Add branch rule&amp;rdquo;. Select the branch &lt;code&gt;master&lt;/code&gt;. Set &amp;ldquo;Allowed to merge&amp;rdquo; to &amp;ldquo;Maintainers&amp;rdquo;. Set &amp;ldquo;Allowed to push and merge&amp;rdquo; to &amp;ldquo;No one&amp;rdquo;. Leave &amp;ldquo;Allow force push&amp;rdquo; disabled.
&lt;p&gt;This means that the only way to land &lt;em&gt;anything&lt;/em&gt; on your mainline is via a Merge Request. When you make a Merge Request, gitlab will offer &amp;ldquo;Set to auto-merge&amp;rdquo;. Use that.
&lt;p&gt;gitlab won&amp;rsquo;t normally merge an MR unless CI passes, although you can override this on a per-MR basis if you need to.
&lt;p&gt;(Sometimes, immediately after creating a merge request in gitlab, you will see a plain &amp;ldquo;Merge&amp;rdquo; button. &lt;a href="https://gitlab.com/gitlab-org/gitlab/-/issues/429516"&gt;This is a bug.&lt;/a&gt; Don&amp;rsquo;t press that. Reload the page so that &amp;ldquo;Set to auto-merge&amp;rdquo; appears.)
&lt;h3&gt;&lt;a name="autopkgtests"&gt;autopkgtests&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Ideally, your package would have meaningful autopkgtests (DEP-8 tests) This makes Salsa CI more useful for you, and also helps detect and defend you against regressions in your dependencies.
&lt;p&gt;The &lt;a href="documentation%20https://ci.debian.net/doc/"&gt;Debian CI docs&lt;/a&gt; are a good starting point. In-depth discussion of writing autopkgtests is beyond the scope of this article.
&lt;h1&gt;&lt;a name="day-to-day-work"&gt;Day-to-day work&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;With this capable tooling, most tasks are much easier.
&lt;h2&gt;&lt;a name="making-changes-to-the-package"&gt;Making changes to the package&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Make all changes via a Salsa Merge Request. So start by making a branch that will become the MR branch.
&lt;p&gt;On your MR branch you can freely edit every file. This includes upstream files, and files in &lt;code&gt;debian/&lt;/code&gt;.
&lt;p&gt;For example, you can:
&lt;ul&gt;&lt;li&gt;Make changes with your editor and commit them.
&lt;li&gt;&lt;code&gt;git cherry-pick&lt;/code&gt; an upstream commit.
&lt;li&gt;&lt;code&gt;git am&lt;/code&gt; a patch from a mailing list or from the Debian Bug System.
&lt;li&gt;&lt;code&gt;git revert&lt;/code&gt; an earlier commit, even an upstream one.
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;When you have a working state of things, tidy up your git branch:
&lt;div style="background-color: #ddf; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git merge&lt;/h5&gt;

&lt;p&gt;Use &lt;code&gt;git-rebase&lt;/code&gt; to squash/edit/combine/reorder commits.
&lt;/p&gt;&lt;/div&gt;
&lt;div style="background-color: #ffa; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git-debrebase&lt;/h5&gt;

&lt;p&gt;Use &lt;code&gt;git-debrebase -i&lt;/code&gt; to squash/edit/combine/reorder commits. When you are happy, run &lt;code&gt;git-debrebase conclude&lt;/code&gt;.
&lt;p&gt;&lt;strong&gt;Do not edit debian/patches/&lt;/strong&gt;. With git-debrebase, this is purely an output. Edit the upstream files directly instead. To reorganise/maintain the patch queue, use &lt;code&gt;git-debrebase -i&lt;/code&gt; to edit the actual commits.
&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;
&lt;h5&gt;&lt;/h5&gt;

&lt;p&gt;Push the MR branch (topic branch) to Salsa and make a Merge Request.
&lt;p&gt;Set the MR to &amp;ldquo;auto-merge when all checks pass&amp;rdquo;. (Or, depending on your team policy, you could ask for an MR Review of course.)
&lt;p&gt;If CI fails, fix up the MR branch, squash/tidy it again, force push the MR branch, and once again set it to auto-merge.
&lt;h2&gt;&lt;a name="test-build"&gt;Test build&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;An informal test build can be done like this:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;apt-get build-dep .
dpkg-buildpackage -uc -b&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Ideally this will leave &lt;code&gt;git status&lt;/code&gt; clean, with no modified or un-ignored untracked files. If it shows untracked files, add them to &lt;code&gt;.gitignore&lt;/code&gt; or &lt;code&gt;debian/.gitignore&lt;/code&gt; as applicable.
&lt;p&gt;If it dirties the tree, consider trying to make it stop doing that. The easiest way is probably to build out-of-tree, if supported upstream. If this is too difficult, you can leave the messy build arrangements as they are, but you&amp;rsquo;ll need to be disciplined about always committing, using git clean and git reset, and so on.
&lt;p&gt;For formal binaries builds, including for testing, use &lt;code&gt;dgit sbuild&lt;/code&gt; as &lt;a href="#uploading-a-new-package-to-debian"&gt;described below for uploading to NEW&lt;/a&gt;.
&lt;h2&gt;&lt;a name="uploading-to-debian"&gt;Uploading to Debian&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Start an MR branch for the administrative changes for the release.
&lt;p&gt;Document all the changes you&amp;rsquo;re going to release, in the &lt;code&gt;debian/changelog&lt;/code&gt;.
&lt;div style="background-color: #ddf; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git merge&lt;/h5&gt;

&lt;p&gt;gbp dch can help write the changelog for you:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;dgit fetch sid
gbp dch --ignore-branch --since=dgit/dgit/sid --git-log=^upstream/main&lt;/code&gt;&lt;/pre&gt;&lt;blockquote style="background-color: #cce; color: #222; font-style: italic;"&gt;
&lt;h6 style="margin-bottom: 0;"&gt;rationale&lt;/h6&gt;

&lt;p&gt;&lt;code&gt;--ignore-branch&lt;/code&gt; is needed because gbp dch wrongly thinks you ought to be running this on &lt;code&gt;master&lt;/code&gt;, but of course you&amp;rsquo;re running it on your MR branch.
&lt;p&gt;The &lt;code&gt;--git-log=^upstream/main&lt;/code&gt; excludes all upstream commits from the listing used to generate the changelog. (I&amp;rsquo;m assuming you have an &lt;code&gt;upstream&lt;/code&gt; remote and that you&amp;rsquo;re basing your work on their &lt;code&gt;main&lt;/code&gt; branch.) If there was a new upstream version, you&amp;rsquo;ll usually want to write a single line about that, and perhaps summarise anything really important.
&lt;/p&gt;&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;(For the first upload after switching to using tag2upload or dgit you need &lt;code&gt;--since=debian/1.2.3-1&lt;/code&gt;, where &lt;code&gt;1.2.3-1&lt;/code&gt; is your previous DEP-14 tag, because &lt;code&gt;dgit/dgit/sid&lt;/code&gt; will be a dsc import, not your actual history.)
&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;
&lt;h5&gt;&lt;/h5&gt;

&lt;p&gt;Change &lt;code&gt;UNRELEASED&lt;/code&gt; to the target suite, and finalise the changelog. (Note that &lt;code&gt;dch&lt;/code&gt; will insist that you at least save the file in your editor.)
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;dch -r
git commit -m &amp;#39;Finalise for upload&amp;#39; debian/changelog&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Make an MR of these administrative changes, and merge it. (Either set it to auto-merge and wait for CI, or if you&amp;rsquo;re in a hurry double-check that it really is just a changelog update so that you can be confident about telling Salsa to &amp;ldquo;Merge unverified changes&amp;rdquo;.)
&lt;p&gt;Now you can perform the actual upload:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;git checkout master
git pull --ff-only # bring the gitlab-made MR merge commit into your local tree&lt;/code&gt;&lt;/pre&gt;&lt;div style="background-color: #ddf; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git merge&lt;/h5&gt;

&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;git-debpush&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div style="background-color: #ffa; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git-debrebase&lt;/h5&gt;

&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;git-debpush --quilt=linear&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;--quilt=linear&lt;/code&gt; is needed only the first time, but it is very important that first time, to tell the system the correct git branch layout.
&lt;/p&gt;&lt;/div&gt;
&lt;h5&gt;&lt;/h5&gt;

&lt;h2&gt;&lt;a name="uploading-a-new-package-to-debian"&gt;Uploading a NEW package to Debian&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;If your package is NEW (completely new source, or has new binary packages) you can&amp;rsquo;t do a source-only upload. You have to build the source and binary packages locally, and upload those build artifacts.
&lt;p&gt;Happily, given the same git branch you&amp;rsquo;d tag for tag2upload, and assuming you have sbuild installed and a suitable chroot, &lt;code&gt;dgit&lt;/code&gt; can help take care of the build and upload for you:
&lt;p&gt;Prepare the changelog update and merge it, as above. Then:
&lt;div style="background-color: #ffa; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git-debrebase&lt;/h5&gt;

&lt;p&gt;Create the orig tarball and launder the git-derebase branch:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;git-deborig
git-debrebase quick&lt;/code&gt;&lt;/pre&gt;&lt;blockquote style="background-color: #ee9; color: #222; font-style: italic;"&gt;
&lt;h6 style="margin-bottom: 0;"&gt;rationale&lt;/h6&gt;

&lt;p&gt;Source package format 3.0 (quilt), which is what I&amp;rsquo;m recommending here for use with git-debrebase, needs an orig tarball; it would also be needed for 1.0-with-diff.
&lt;/p&gt;&lt;/blockquote&gt;

&lt;/p&gt;&lt;/div&gt;
&lt;h5&gt;&lt;/h5&gt;

&lt;p&gt;Build the source and binary packages, locally:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;dgit sbuild
dgit push-built&lt;/code&gt;&lt;/pre&gt;&lt;blockquote style="background-color: #eee; color: #222; font-style: italic;"&gt;
&lt;h6 style="margin-bottom: 0;"&gt;rationale&lt;/h6&gt;

&lt;p&gt;You don&amp;rsquo;t &lt;em&gt;have to&lt;/em&gt; use &lt;code&gt;dgit sbuild&lt;/code&gt;, but it is usually convenient to do so, because unlike sbuild, dgit understands git. Also it works around a &lt;a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=908747"&gt;gitignore-related defect&lt;/a&gt; in dpkg-source.
&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;&lt;a name="new-upstream-version"&gt;New upstream version&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Find the new upstream version number and corresponding tag. (Let&amp;rsquo;s suppose it&amp;rsquo;s &lt;code&gt;1.2.4&lt;/code&gt;.) Check the provenance:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;git verify-tag v1.2.4&lt;/code&gt;&lt;/pre&gt;&lt;blockquote style="background-color: #eee; color: #222; font-style: italic;"&gt;
&lt;h6 style="margin-bottom: 0;"&gt;rationale&lt;/h6&gt;

&lt;p&gt;Not all upstreams sign their git tags, sadly. Sometimes encouraging them to do so can help. You may need to use some other method(s) to check that you have the right git commit for the release.
&lt;/p&gt;&lt;/blockquote&gt;

&lt;div style="background-color: #ddf; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git merge&lt;/h5&gt;

&lt;p&gt;Simply merge the new upstream version and update the changelog:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;git merge v1.2.4
dch -v1.2.4-1 &amp;#39;New upstream release.&amp;#39;&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;/div&gt;
&lt;div style="background-color: #ffa; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git-debrebase&lt;/h5&gt;

&lt;p&gt;Rebase your delta queue onto the new upstream version:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;git debrebase mew-upstream 1.2.4&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;&lt;/div&gt;
&lt;h5&gt;&lt;/h5&gt;

&lt;p&gt;If there are conflicts between your Debian delta for 1.2.3, and the upstream changes in 1.2.4, this is when you need to resolve them, as part of &lt;code&gt;git merge&lt;/code&gt; or &lt;code&gt;git (deb)rebase&lt;/code&gt;.
&lt;p&gt;After you&amp;rsquo;ve completed the merge, test your package and make any further needed changes. When you have it working in a local branch, make a Merge Request, as above.
&lt;h2&gt;&lt;a name="sponsorship"&gt;Sponsorship&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;git-based sponsorship is super easy! The sponsee can maintain their git branch on Salsa, and do all normal maintenance via gitlab operations.
&lt;p&gt;When the time comes to upload, the sponsee notifies the sponsor that it&amp;rsquo;s time. The sponsor fetches and checks out the git branch from Salsa, does their checks, as they judge appropriate, and when satisfied runs &lt;code&gt;git-debpush&lt;/code&gt;.
&lt;p&gt;As part of the sponsor&amp;rsquo;s checks, they might want to see all changes since the last upload to Debian:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;dgit fetch sid
git diff dgit/dgit/sid..HEAD&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Or to see the Debian delta of the proposed upload:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;git verify-tag v1.2.3
git diff v1.2.3..HEAD &amp;#39;:!debian&amp;#39;&lt;/code&gt;&lt;/pre&gt;&lt;div style="background-color: #ffa; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git-debrebase&lt;/h5&gt;

&lt;p&gt;Or to show all the delta as a series of commits:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;git log -p v1.2.3..HEAD &amp;#39;:!debian&amp;#39;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Don&amp;rsquo;t look at &lt;code&gt;debian/patches/&lt;/code&gt;. It can be absent or out of date.
&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;
&lt;h5&gt;&lt;/h5&gt;

&lt;h2&gt;&lt;a name="incorporating-an-nmu"&gt;Incorporating an NMU&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Fetch the NMU into your local git, and see what it contains:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;dgit fetch sid
git diff master...dgit/dgit/sid&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If the NMUer &lt;a href="https://manpages.debian.org/testing/dgit/dgit-nmu-simple.7.en.html"&gt;used dgit&lt;/a&gt;, then &lt;code&gt;git log dgit/dgit/sid&lt;/code&gt; will show you the commits they made.
&lt;p&gt;Normally the best thing to do is to simply merge the NMU, and then do any reverts or rework in followup commits:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;git merge dgit/dgit/sid&lt;/code&gt;&lt;/pre&gt;&lt;div style="background-color: #ffa; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git-debrebase&lt;/h5&gt;

&lt;p&gt;You should &lt;code&gt;git-debrebase quick&lt;/code&gt; at this stage, to check that the merge went OK and the package still has a lineariseable delta queue.
&lt;/p&gt;&lt;/div&gt;
&lt;h5&gt;&lt;/h5&gt;

&lt;p&gt;Then make any followup changes that seem appropriate. Supposing your previous maintainer upload was &lt;code&gt;1.2.3-7&lt;/code&gt;, you can go back and see the NMU diff again with:
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;git diff debian/1.2.3-7...dgit/dgit/sid&lt;/code&gt;&lt;/pre&gt;&lt;div style="background-color: #ffa; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git-debrebase&lt;/h5&gt;

&lt;p&gt;The actual changes made to upstream files will always show up as diff hunks to those files. diff commands will often also show you changes to &lt;code&gt;debian/patches/&lt;/code&gt;. Normally it&amp;rsquo;s best to filter them out with &lt;code&gt;git diff ... &amp;#39;:!debian/patches&amp;#39;&lt;/code&gt;
&lt;p&gt;If you&amp;rsquo;d prefer to read the changes to the delta queue as an interdiff (diff of diffs), you can do something like
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;git checkout debian/1.2.3-7
git-debrebase --force make-patches
git diff HEAD...dgit/dgit/sid -- :debian/patches&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;to diff against a version with &lt;code&gt;debian/patches/&lt;/code&gt; up to date. (The NMU, in &lt;code&gt;dgit/dgit/sid&lt;/code&gt;, will necessarily have the patches already up to date.)
&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;
&lt;h5&gt;&lt;/h5&gt;

&lt;h2&gt;&lt;a name="dfsg-filtering-handling-non-free-files"&gt;DFSG filtering (handling non-free files)&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Some upstreams ship non-free files of one kind of another. Often these are just in the tarballs, in which case basing your work on upstream git avoids the problem. But if the files are in upstream&amp;rsquo;s git trees, you need to filter them out.
&lt;p&gt;&lt;strong&gt;This advice is not for (legally or otherwise) dangerous files&lt;/strong&gt;. If your package contains files that may be illegal, or hazardous, you need much more serious measures. In this case, even pushing the upstream git history to any Debian service, including Salsa, must be avoided. If you suspect this situation you should seek advice, privately and as soon as possible, from dgit-owner@d.o and/or the DFSG team. Thankfully, legally dangerous files are very rare in upstream git repositories, for obvious reasons.
&lt;p&gt;Our approach is to make a filtered git branch, based on the upstream history, with the troublesome files removed. We then treat that as the upstream for all of the rest of our work.
&lt;blockquote style="background-color: #eee; color: #222; font-style: italic;"&gt;
&lt;h6 style="margin-bottom: 0;"&gt;rationale&lt;/h6&gt;

&lt;p&gt;Yes, this will end up including the non-free files in the git history, on official Debian servers. That&amp;rsquo;s OK. What&amp;rsquo;s forbidden is non-free material in the Debianised git tree, or in the source packages.
&lt;/p&gt;&lt;/blockquote&gt;

&lt;h3&gt;&lt;a name="initial-filtering"&gt;Initial filtering&lt;/a&gt;&lt;/h3&gt;
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;git checkout -b upstream-dfsg v1.2.3
git rm nonfree.exe
git commit -m &amp;quot;upstream version 1.2.3 DFSG-cleaned&amp;quot;
git tag -s -m &amp;quot;upstream version 1.2.3 DFSG-cleaned&amp;quot; v1.2.3+ds1
git push origin upstream-dfsg&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;And now, use &lt;code&gt;1.2.3+ds1&lt;/code&gt;, and the filtered branch &lt;code&gt;upstream-dfsg&lt;/code&gt;, as the upstream version, instead of &lt;code&gt;1.2.3&lt;/code&gt; and &lt;code&gt;upstream/main&lt;/code&gt;. Follow the steps for &lt;a href="#convert-the-git-branch"&gt;Convert the git branch&lt;/a&gt; or &lt;a href="#new-upstream-version"&gt;New upstream version&lt;/a&gt;, as applicable, adding &lt;code&gt;+ds1&lt;/code&gt; into &lt;code&gt;debian/changelog&lt;/code&gt;.
&lt;p&gt;If you missed something and need to filter out more a nonfree files, re-use the same &lt;code&gt;upstream-dfsg&lt;/code&gt; branch and bump the &lt;code&gt;ds&lt;/code&gt; version, eg &lt;code&gt;v1.2.3+ds2&lt;/code&gt;.
&lt;h3&gt;&lt;a name="subsequent-upstream-releases"&gt;Subsequent upstream releases&lt;/a&gt;&lt;/h3&gt;
&lt;pre style="margin-left: 1em;"&gt;&lt;code&gt;git checkout upstream-dfsg
git merge v1.2.4
git rm additional-nonfree.exe # if any
git commit -m &amp;quot;upstream version 1.2.4 DFSG-cleaned&amp;quot;
git tag -s -m &amp;quot;upstream version 1.2.4 DFSG-cleaned&amp;quot; v1.2.4+ds1
git push origin upstream-dfsg&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;&lt;a name="removing-files-by-pattern"&gt;Removing files by pattern&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;If the files you need to remove keep changing, you could automate things with a small shell script &lt;code&gt;debian/rm-nonfree&lt;/code&gt; containing appropriate &lt;code&gt;git rm&lt;/code&gt; commands. If you use &lt;code&gt;git rm -f&lt;/code&gt; it will succeed even if the &lt;code&gt;git merge&lt;/code&gt; from real upstream has conflicts due to changes to non-free files.
&lt;blockquote style="background-color: #eee; color: #222; font-style: italic;"&gt;
&lt;h6 style="margin-bottom: 0;"&gt;rationale&lt;/h6&gt;

&lt;p&gt;Ideally &lt;code&gt;uscan&lt;/code&gt;, which has a way of representing DFSG filtering patterns in &lt;code&gt;debian/watch&lt;/code&gt;, would be able to do this, but sadly the relevant functionality is entangled with uscan&amp;rsquo;s tarball generation.
&lt;/p&gt;&lt;/blockquote&gt;

&lt;h1&gt;&lt;a name="common-issues"&gt;Common issues&lt;/a&gt;&lt;/h1&gt;
&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;Tarball contents&lt;/strong&gt;: If you are switching from upstream tarballs to upstream git, you may find that the git tree is significantly different.
&lt;p&gt;It may be missing files that your current build system relies on. If so, you definitely want to be using git, not the tarball. Those extra files in the tarball are intermediate built products, but in Debian we should be building from the real source! Fixing this may involve some work, though.

&lt;li&gt;&lt;p&gt;&lt;strong&gt;gitattributes&lt;/strong&gt;:
&lt;p&gt;For &lt;a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1079434#20"&gt;Reasons&lt;/a&gt; the dgit and tag2upload system disregards and disables the use of &lt;code&gt;.gitattributes&lt;/code&gt; to modify files as they are checked out.
&lt;p&gt;Normally this doesn&amp;rsquo;t cause a problem so long as any orig tarballs are generated the same way (as they will be by tag2upload or &lt;code&gt;git-deborig&lt;/code&gt;). But if the package or build system relies on them, you may need to institute some workarounds, or, replicate the effect of the gitattributes as commits in git.

&lt;li&gt;&lt;p&gt;&lt;strong&gt;git submodules&lt;/strong&gt;: &lt;a href="https://diziet.dreamwidth.org/14666.html"&gt;git submodules are terrible&lt;/a&gt; and should never ever be used. But not everyone has got the message, so your upstream may be using them.
&lt;p&gt;If you&amp;rsquo;re lucky, the code in the submodule isn&amp;rsquo;t used in which case you can &lt;code&gt;git rm&lt;/code&gt; the submodule.

&lt;/p&gt;&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;h1&gt;&lt;a name="further-reading"&gt;Further reading&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;I&amp;rsquo;ve tried to cover the most common situations. But software is complicated and there are many exceptions that this article can&amp;rsquo;t cover without becoming much harder to read.
&lt;p&gt;You may want to look at:
&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;dgit workflow manpages&lt;/strong&gt;: As part of the git transition project, we have written workflow manpages, which are more comprehensive than this article. They&amp;rsquo;re centered around use of dgit, but also discuss tag2upload where applicable.
&lt;p&gt;These cover a much wider range of possibilities, including (for example) choosing different source package formats, how to handle upstreams that publish only tarballs, etc. They are correspondingly much less opinionated.
&lt;p&gt;Look in &lt;a href="https://manpages.debian.org/testing/dgit/dgit-maint-merge.7.en.html"&gt;dgit-maint-merge(7)&lt;/a&gt; and &lt;a href="https://manpages.debian.org/testing/dgit/dgit-maint-debrebase.7.en.html"&gt;dgit-maint-debrebase(7)&lt;/a&gt;. There is also &lt;a href="https://manpages.debian.org/testing/dgit/dgit-maint-gbp.7.en.html"&gt;dgit-maint-gbp(7)&lt;/a&gt; for those who want to keep using &lt;code&gt;gbp pq&lt;/code&gt; and/or &lt;code&gt;quilt&lt;/code&gt; with a patches-unapplied branch.

&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;NMUs&lt;/strong&gt; are very easy with dgit. (tag2upload is usually less suitable than dgit, for an NMU.)
&lt;p&gt;You can work with any package, in git, in a completely uniform way, regardless of maintainer git workflow, See &lt;a href="https://manpages.debian.org/testing/dgit/dgit-nmu-simple.7.en.html"&gt;dgit-nmu-simple(7)&lt;/a&gt;.

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Native packages&lt;/strong&gt; (meaning packages maintained wholly within Debian) are much simpler. See &lt;a href="https://manpages.debian.org/testing/dgit/dgit-maint-native.7.en.html"&gt;dgit-maint-native(7)&lt;/a&gt;.

&lt;li&gt;&lt;p&gt;&lt;strong&gt;tag2upload documentation&lt;/strong&gt;: The &lt;a href="https://wiki.debian.org/tag2upload"&gt;tag2upload wiki page&lt;/a&gt; is a good starting point. There&amp;rsquo;s the &lt;a href="https://manpages.debian.org/testing/git-debpush/git-debpush.1.en.html"&gt;git-debpush(1)&lt;/a&gt; manpage of course.

&lt;li&gt;&lt;p&gt;&lt;strong&gt;dgit reference documentation&lt;/strong&gt;:
&lt;p&gt;There is a comprehensive command-line manual in &lt;a href="https://manpages.debian.org/testing/dgit/dgit.1.en.html"&gt;dgit(1)&lt;/a&gt;. Description of the dgit data model and Principles of Operation is in &lt;a href="https://manpages.debian.org/testing/dgit/dgit.7.en.html"&gt;dgit(7)&lt;/a&gt;; including coverage of out-of-course situations.
&lt;p&gt;dgit is a complex and powerful program so this reference material can be overwhelming. So, we recommend starting with a guide like this one, or the dgit-&amp;hellip;(7) workflow tutorials.

&lt;li&gt;&lt;p&gt;&lt;strong&gt;Design and implementation documentation for tag2upload&lt;/strong&gt; is &lt;a href="https://wiki.debian.org/tag2upload#Signatures_and_traceability"&gt;linked to from the wiki&lt;/a&gt;.

&lt;li&gt;&lt;p&gt;&lt;a href="https://diziet.dreamwidth.org/20436.html"&gt;&lt;strong&gt;Debian&amp;rsquo;s git transition&lt;/strong&gt;&lt;/a&gt; blog post from December.
&lt;p&gt;tag2upload and dgit are part of the git transition project, and aim to support a very wide variety of git workflows. tag2upload and dgit work well with existing git tooling, including git-buildpackage-based approaches.
&lt;p&gt;git-debrebase is conceptually separate from, and functionally independent of, tag2upload and dgit. It&amp;rsquo;s a git workflow and delta management tool, competing with &lt;code&gt;gbp pq&lt;/code&gt;, manual use of &lt;code&gt;quilt&lt;/code&gt;, &lt;code&gt;git-dpm&lt;/code&gt; and so on.

&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;div style="background-color: #ffa; color: #000"&gt;
&lt;h5 style="margin-bottom: 0;"&gt;git-debrebase&lt;/h5&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;git-debrebase reference documentation&lt;/strong&gt;:
&lt;p&gt;Of course there&amp;rsquo;s a comprehensive command-line manual in &lt;a href="https://manpages.debian.org/testing/git-debrebase/git-debrebase.1.en.html"&gt;git-debrebase(1)&lt;/a&gt;.
&lt;p&gt;git-debrebase is quick and easy to use, but it has a complex data model and sophisticated algorithms. This is documented in &lt;a href="https://manpages.debian.org/testing/git-debrebase/git-debrebase.5.en.html"&gt;git-debrebase(5)&lt;/a&gt;.

&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;/div&gt;
&lt;h5&gt;&lt;/h5&gt;


&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;
&lt;hr&gt;
&lt;address&gt;
Edited 2026-03-05 18:48 UTC to add a missing &lt;code&gt;--noop-ok&lt;/code&gt; to the Salsa CI runes.  Thanks to Charlemagne Lasse for &lt;a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1129577"&gt;the report&lt;/a&gt;.  Apologies if this causes Debian Planet to re-post this article as if it were new.
&lt;/address&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=diziet&amp;ditemid=20851" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-21:377446:20436</id>
    <link rel="alternate" type="text/html" href="https://diziet.dreamwidth.org/20436.html"/>
    <link rel="self" type="text/xml" href="https://diziet.dreamwidth.org/data/atom/?itemid=20436"/>
    <title>Debian’s git transition</title>
    <published>2025-12-21T23:08:31Z</published>
    <updated>2025-12-21T23:24:29Z</updated>
    <category term="git"/>
    <category term="tag2upload"/>
    <category term="dgit"/>
    <category term="debian"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">&lt;p&gt;tl;dr:
&lt;p&gt;There is a Debian git transition plan. It&amp;rsquo;s going OK so far but we need help, especially with outreach and updating Debian&amp;rsquo;s documentation.
&lt;ul&gt;&lt;li&gt;&lt;a href="#goals-of-the-debian-git-transition-project"&gt;Goals of the Debian git transition project&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="#achievements-so-far-and-current-status"&gt;Achievements so far, and current status&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;li&gt;&lt;a href="#core-engineering-principle"&gt;Core engineering principle&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="#correspondence-between-dsc-and-git"&gt;Correspondence between dsc and git&lt;/a&gt;
&lt;li&gt;&lt;a href="#patches-applied-vs-patches-unapplied"&gt;Patches-applied vs patches-unapplied&lt;/a&gt;
&lt;li&gt;&lt;a href="#consequences-some-of-which-are-annoying"&gt;Consequences, some of which are annoying&lt;/a&gt;
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;li&gt;&lt;a href="#distributing-the-source-code-as-git"&gt;Distributing the source code as git&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="#tracking-the-relevant-git-data-when-changes-are-made-in-the-legacy-archive"&gt;Tracking the relevant git data, when changes are made in the legacy Archive&lt;/a&gt;
&lt;li&gt;&lt;a href="#why-.dgit.debian.org-is-not-salsa"&gt;Why *.dgit.debian.org is not Salsa&lt;/a&gt;
&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;li&gt;&lt;a href="#roadmap"&gt;Roadmap&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="#in-progress"&gt;In progress&lt;/a&gt;
&lt;li&gt;&lt;a href="#future-technology"&gt;Future Technology&lt;/a&gt;
&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;li&gt;&lt;a href="#mindshare-and-adoption---please-help"&gt;Mindshare and adoption - please help!&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="#a-rant-about-publishing-the-source-code"&gt;A rant about publishing the source code&lt;/a&gt;
&lt;li&gt;&lt;a href="#documentation"&gt;Documentation&lt;/a&gt;
&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;li&gt;&lt;a href="#personnel"&gt;Personnel&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="#thanks"&gt;Thanks&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;a name="cutid1"&gt;&lt;/a&gt;
&lt;h1&gt;&lt;a name="goals-of-the-debian-git-transition-project"&gt;Goals of the Debian git transition project&lt;/a&gt;&lt;/h1&gt;
&lt;ol start="0" type="1"&gt;&lt;li&gt;&lt;strong&gt;Everyone who interacts with Debian source code should be able to do so entirely in git.&lt;/strong&gt;
&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;That means, more specifically:
&lt;ol type="1"&gt;&lt;li&gt;&lt;p&gt;All examination and edits to the source should be performed via normal git operations.

&lt;li&gt;&lt;p&gt;Source code should be transferred and exchanged as git data, not tarballs. git should be the canonical form everywhere.

&lt;li&gt;&lt;p&gt;Upstream git histories should be re-published, traceably, as part of formal git releases published by Debian.

&lt;li&gt;&lt;p&gt;No-one should have to learn about Debian Source Packages, which are bizarre, and have been obsoleted by modern version control.

&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;This is very ambitious, but we have come a long way!
&lt;h2&gt;&lt;a name="achievements-so-far-and-current-status"&gt;Achievements so far, and current status&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;We have come a very long way. But, there is still much to do - especially, the git transition team &lt;strong&gt;needs your help with adoption, developer outreach, and developer documentation overhaul.&lt;/strong&gt;
&lt;p&gt;We&amp;rsquo;ve made big strides towards goals 1 and 4. Goal 2 is partially achieved: we currently have dual running. Goal 3 is within our reach but depends on widespread adoption of tag2upload (and/or dgit push).
&lt;p&gt;Downstreams and users can &lt;a href="https://diziet.dreamwidth.org/17579.html"&gt;obtain the source code of any Debian package&lt;/a&gt; in git form. (&lt;a href="https://manpages.debian.org/trixie/dgit/dgit.1.en.html#dgit"&gt;dgit clone&lt;/a&gt;, 2013). They can then work with this source code completely in git, including building binaries, merging new versions, even automatically (eg &lt;a href="https://github.com/plugwash/autoforwardportergit?tab=readme-ov-file#pooltogit"&gt;Raspbian&lt;/a&gt;, 2016), and all without having to deal with source packages at all (eg &lt;a href="https://debconf25.debconf.org/talks/119-automating-downstream-debian-package-builds-and-updates-in-ci/"&gt;Wikimedia&lt;/a&gt; 2025).
&lt;p&gt;A Debian maintainer can maintain their own package entirely in git. They can obtain upstream source code from git, and do their packaging work in git (&lt;code&gt;git-buildpackage&lt;/code&gt;, 2006).
&lt;p&gt;Every Debian maintainer can (and should!) release their package &lt;em&gt;from git&lt;/em&gt; reliably and in a standard form (&lt;a href="https://manpages.debian.org/trixie/dgit/dgit.1.en.html#dgit~15"&gt;dgit push&lt;/a&gt;, 2013; &lt;a href="https://wiki.debian.org/tag2upload"&gt;tag2upload&lt;/a&gt;, 2025). This is not only more principled, but also more convenient, and with better UX, than pre-dgit tooling like &lt;code&gt;dput&lt;/code&gt;.
&lt;p&gt;Indeed a Debian maintainer can now often release their changes to Debian, from git, using &lt;em&gt;only&lt;/em&gt; git branches (so no tarballs). Releasing to Debian can be simply pushing a signed tag (&lt;a href="https://wiki.debian.org/tag2upload"&gt;tag2upload&lt;/a&gt;, 2025).
&lt;p&gt;A Debian maintainer can maintain a stack of changes to upstream source code in git (&lt;a href="https://manpages.debian.org/trixie/git-buildpackage/gbp-pq.1.en.html"&gt;gbp pq&lt;/a&gt; 2009). They can even maintain such a delta series as a rebasing git branch, directly buildable, and use normal &lt;code&gt;git rebase&lt;/code&gt; style operations to edit their changes, (&lt;a href="https://manpages.debian.org/trixie/git-dpm/git-dpm.1.en.html"&gt;git-dpm&lt;/a&gt;, 2010; &lt;a href="https://manpages.debian.org/trixie/git-debrebase/git-debrebase.1.en.html"&gt;git-debrebase&lt;/a&gt;, 2018)
&lt;p&gt;An authorised Debian developer can do a modest update to &lt;em&gt;any&lt;/em&gt; package in Debian, even one maintained by someone else, working entirely in git in a &lt;a href="https://manpages.debian.org/testing/dgit/dgit-nmu-simple.7.en.html"&gt;standard and convenient way&lt;/a&gt; (dgit, 2013).
&lt;p&gt;Debian contributors can share their work-in-progress on git forges and collaborate using merge requests, git based code review, and so on. (Alioth, 2003; Salsa, 2018.)
&lt;h1&gt;&lt;a name="core-engineering-principle"&gt;Core engineering principle&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;The Debian git transition project is based on one core engineering principle:
&lt;p&gt;&lt;strong&gt;Every Debian Source Package can be losslessly converted to and from git.&lt;/strong&gt;
&lt;p&gt;In order to &lt;em&gt;transition&lt;/em&gt; away from Debian Source Packages, we need to &lt;em&gt;gateway&lt;/em&gt; between the old &lt;code&gt;dsc&lt;/code&gt; approach, and the new git approach.
&lt;p&gt;This gateway obviously needs to be bidirectional: source packages uploaded with legacy tooling like &lt;code&gt;dput&lt;/code&gt; need to be imported into a canonical git representation; and of course git branches prepared by developers need to be converted to source packages for the benefit of legacy downstream systems (such as the Debian Archive and &lt;code&gt;apt source&lt;/code&gt;).
&lt;p&gt;This bidirectional gateway is implemented in &lt;a href="https://salsa.debian.org/dgit-team/dgit"&gt;&lt;code&gt;src:dgit&lt;/code&gt;&lt;/a&gt;, and is allowing us to gradually replace dsc-based parts of the Debian system with git-based ones.
&lt;h2&gt;&lt;a name="correspondence-between-dsc-and-git"&gt;Correspondence between dsc and git&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A faithful bidirectional gateway must define an invariant:
&lt;p&gt;&lt;strong&gt;The canonical git tree, corresponding to a .dsc, is the tree resulting from &lt;code&gt;dpkg-source -x&lt;/code&gt;&lt;/strong&gt;.
&lt;p&gt;This canonical form is sometimes called the &amp;ldquo;dgit view&amp;rdquo;. It&amp;rsquo;s sometimes not the same as the maintainer&amp;rsquo;s git branch, because many maintainers are still working with &amp;ldquo;patches-unapplied&amp;rdquo; git branches. More on this below.
&lt;p&gt;(For &lt;code&gt;3.0 (quilt)&lt;/code&gt; .dscs, the canonical git tree doesn&amp;rsquo;t include the quilt &lt;code&gt;.pc&lt;/code&gt; directory.)
&lt;h2&gt;&lt;a name="patches-applied-vs-patches-unapplied"&gt;Patches-applied vs patches-unapplied&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The canonical git format is &amp;ldquo;patches applied&amp;rdquo;. That is:
&lt;p&gt;&lt;strong&gt;If Debian has modified the upstream source code, a normal git clone of the canonical branch gives the modified source tree, ready for reading and building.&lt;/strong&gt;
&lt;p&gt;Many Debian maintainers keep their packages in a different git branch format, where the changes made by Debian, to the upstream source code, are in actual &lt;code&gt;patch&lt;/code&gt; files in a &lt;code&gt;debian/patches/&lt;/code&gt; subdirectory.
&lt;p&gt;Patches-applied has a number of important advantages over patches-unapplied:
&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;strong&gt;It is familiar to, and doesn&amp;rsquo;t trick, outsiders to Debian&lt;/strong&gt;. Debian insiders radically underestimate how weird &amp;ldquo;patches-unapplied&amp;rdquo; is. Even expert software developers can get very confused or even &lt;a href="https://diziet.dreamwidth.org/9556.html"&gt;accidentally build binaries without security patches&lt;/a&gt;!

&lt;li&gt;&lt;p&gt;Making changes can be done with just normal git commands, eg &lt;code&gt;git commit&lt;/code&gt;. Many Debian insiders working with patches-unapplied are still using &lt;a href="https://manpages.debian.org/trixie/quilt/quilt.1.en.html"&gt;&lt;code&gt;quilt(1)&lt;/code&gt;&lt;/a&gt;, a footgun-rich contraption for working with patch files!

&lt;li&gt;&lt;p&gt;When developing, one can make changes to upstream code, and to Debian packaging, together, without ceremony. There is no need to switch back and forth between patch queue and packaging branches (as with &lt;code&gt;gbp pq&lt;/code&gt;), no need to &amp;ldquo;commit&amp;rdquo; patch files, etc. One can always edit every file and commit it with &lt;code&gt;git commit&lt;/code&gt;.

&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;The downside is that, with the (bizarre) &lt;code&gt;3.0 (quilt)&lt;/code&gt; source format, the patch files files in &lt;code&gt;debian/patches/&lt;/code&gt; must somehow be kept up to date. Nowadays though, tools like &lt;code&gt;git-debrebase&lt;/code&gt; and &lt;code&gt;git-dpm&lt;/code&gt; (and dgit for NMUs) make it very easy to work with patches-applied git branches. &lt;code&gt;git-debrebase&lt;/code&gt; can deal very ergonomically even with &lt;a href="https://salsa.debian.org/xen-team/debian-xen"&gt;big patch stacks&lt;/a&gt;.
&lt;p&gt;(For smaller packages which usually have no patches, &lt;a href="https://manpages.debian.org/trixie/dgit/dgit-maint-merge.7.en.html"&gt;plain &lt;code&gt;git merge&lt;/code&gt; with an upstream git branch&lt;/a&gt;, and a &lt;a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1007717#384"&gt;much simpler dsc format&lt;/a&gt;, sidesteps the problem entirely.)
&lt;h3&gt;&lt;a name="prioritising-debians-users-and-other-outsiders"&gt;Prioritising Debian&amp;rsquo;s users (and other outsiders)&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;We want everyone to be able to share and modify the software that they interact with. That means we should make source code truly accessible, on the user&amp;rsquo;s terms.
&lt;p&gt;Many of Debian&amp;rsquo;s processes assume everyone is an insider. It&amp;rsquo;s okay that there are Debian insiders and that people feel part of something that they worked hard to become involved with. But lack of perspective can lead to software which fails to uphold our values.
&lt;p&gt;Our source code practices &amp;mdash; in particular, our determination to share properly (and systematically) &amp;mdash; are a key part of what makes Debian worthwhile at all. Like Debian&amp;rsquo;s installer, we want our source code to be useable by Debian outsiders.
&lt;p&gt;This is why we have chosen to privilege a git branch format which is more familiar to the world at large, even if it&amp;rsquo;s less popular in Debian.
&lt;h2&gt;&lt;a name="consequences-some-of-which-are-annoying"&gt;Consequences, some of which are annoying&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The requirement that the conversion be &lt;em&gt;bidirectional&lt;/em&gt;, &lt;em&gt;lossless&lt;/em&gt;, and &lt;em&gt;context-free&lt;/em&gt; can be inconvenient.
&lt;p&gt;For example, &lt;a href="https://manpages.debian.org/trixie/dgit/dgit.7.en.html#GITATTRIBUTES"&gt;we cannot support &lt;code&gt;.gitattributes&lt;/code&gt;&lt;/a&gt; which modify files during git checkin and checkout. &lt;code&gt;.gitattributes&lt;/code&gt; cause the meaning of a git tree to depend on the context, in possibly arbitrary ways, so the conversion from git to source package wouldn&amp;rsquo;t be stable. And, worse, some source packages might not to be representable in git at all.
&lt;p&gt;Another example: Maintainers often have existing git branches for their packages, generated with pre-dgit tooling which is less careful and less principled than ours. That can result in discrepancies between git and dsc, which need to be resolved before a proper git-based upload can succeed.
&lt;p&gt;That some maintainers use patches-unapplied, and some patches-unapplied, means that there &lt;em&gt;has&lt;/em&gt; to be some kind of conversion to a standard git representation. Choosing the less-popular patches-applied format as the canonical form, means that &lt;em&gt;many&lt;/em&gt; packages need their git representation converted. It also means that user- and outsider-facing branches from &lt;code&gt;{browse,git}.dgit.d.o&lt;/code&gt; and &lt;code&gt;dgit clone&lt;/code&gt; are not always compatible with maintainer branches on Salsa. User-contributed changes need cherry-picking rather than merging, or conversion back to the maintainer format. The good news is that dgit can automate much of this, and the manual parts are usually easy git operations.
&lt;h1&gt;&lt;a name="distributing-the-source-code-as-git"&gt;Distributing the source code as git&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Our source code management should be normal, modern, and based on git. That means the Debian Archive is obsolete and needs to be replaced with a set of git repositories.
&lt;p&gt;The replacement repository for source code formally released to Debian is &lt;a href="https://browse.dgit.debian.org/"&gt;&lt;code&gt;*.dgit.debian.org&lt;/code&gt;&lt;/a&gt;. This contains all the git objects for every git-based upload since 2013, including the signed tag for each released package version.
&lt;p&gt;The plan is that it will contain a git view of &lt;em&gt;every&lt;/em&gt; uploaded Debian package, by centrally importing all legacy uploads into git.
&lt;h2&gt;&lt;a name="tracking-the-relevant-git-data-when-changes-are-made-in-the-legacy-archive"&gt;Tracking the relevant git data, when changes are made in the legacy Archive&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Currently, many critical source code management tasks are done by changes to the legacy Debian Archive, which works entirely with dsc files (and the associated tarballs etc). The contents of the Archive are therefore still an important source of truth. But, the Archive&amp;rsquo;s architecture means it cannot sensibly directly contain git data.
&lt;p&gt;To track changes made in the Archive, we added the &lt;a href="https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-dgit"&gt;&lt;code&gt;Dgit:&lt;/code&gt;&lt;/a&gt; field to the &lt;code&gt;.dsc&lt;/code&gt; of a git-based upload (2013). This declares which git commit this package was converted from. and where those git objects can be obtained.
&lt;p&gt;Thus, given a Debian Source Package from a git-based upload, it is possible for the new git tooling to obtain the equivalent git objects. If the user is going to work in git, there is no need for any tarballs to be downloaded: the git data could be obtained from the depository using the git protocol.
&lt;p&gt;The &lt;a href="https://browse.dgit.debian.org/libsdl2-ttf.git/tag/?h=archive/debian/2.24.0%2bdfsg-3"&gt;signed&lt;/a&gt; &lt;a href="https://browse.dgit.debian.org/libsdl2-ttf.git/tag/?h=debian/2.24.0%2bdfsg-3"&gt;tags&lt;/a&gt;, available from the git depository, have &lt;a href="https://manpages.debian.org/trixie/git-debpush/tag2upload.5.en.html"&gt;standardised metdata&lt;/a&gt; which gives traceability back to the uploading Debian contributor.
&lt;h2&gt;&lt;a name="why-.dgit.debian.org-is-not-salsa"&gt;Why *.dgit.debian.org is not Salsa&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;We need a git &lt;em&gt;depository&lt;/em&gt; - a formal, reliable and permanent git repository of source code actually released to Debian.
&lt;p&gt;Git forges like Gitlab can be very convenient. But Gitlab is not sufficiently secure, &lt;a href="https://gitlab.com/gitlab-org/gitlab/-/issues/429516"&gt;and&lt;/a&gt; &lt;a href="https://gitlab.com/gitlab-org/gitlab/-/issues/472646"&gt;too&lt;/a&gt; &lt;a href="https://gitlab.com/gitlab-org/gitlab/-/issues/581752"&gt;full&lt;/a&gt; &lt;a href="https://gitlab.com/gitlab-org/gitlab/-/issues/581897"&gt;of&lt;/a&gt; &lt;a href="https://gitlab.com/gitlab-org/gitlab/-/issues/217231"&gt;bugs&lt;/a&gt;, to be the principal and only archive of all our source code. (The &amp;ldquo;open core&amp;rdquo; business model of the Gitlab corporation, and the constant-churn development approach, are &lt;a href="https://mako.cc/writing/hill-free_tools.html"&gt;critical&lt;/a&gt; underlying problems.)
&lt;p&gt;Our git depository lacks forge features like Merge Requests. But:
&lt;ul&gt;&lt;li&gt;It is dependable, both in terms of reliability and security.
&lt;li&gt;It is append-only: once something is pushed, it is permanently recorded.
&lt;li&gt;Its access control is precisely that of the Debian Archive.
&lt;li&gt;Its ref namespace is standardised and corresponds to Debian releases.
&lt;li&gt;Pushes are authorised by PGP signatures, not ssh keys, so traceable.
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;The dgit git depository outlasted Alioth and it may well outlast Salsa.
&lt;p&gt;We need &lt;em&gt;both&lt;/em&gt; a good forge, and the &lt;code&gt;*.dgit.debian.org&lt;/code&gt; formal git depository.
&lt;h1&gt;&lt;a name="roadmap"&gt;Roadmap&lt;/a&gt;&lt;/h1&gt;
&lt;h2&gt;&lt;a name="in-progress"&gt;In progress&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Right now we are quite focused on &lt;a href="https://wiki.debian.org/tag2upload"&gt;&lt;strong&gt;tag2upload&lt;/strong&gt;&lt;/a&gt;.
&lt;p&gt;We are working hard on eliminating the remaining issues that we feel need to be addressed before declaring the service out of beta.
&lt;h2&gt;&lt;a name="future-technology"&gt;Future Technology&lt;/a&gt;&lt;/h2&gt;
&lt;h3&gt;&lt;a name="whole-archive-dsc-importer"&gt;Whole-archive dsc importer&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Currently, the git depository only has git data for git-based package updates (tag2upload and dgit push). Legacy dput-based uploads are not currently present there. This means that the git-based and legacy uploads must be resolved client-side, by &lt;code&gt;dgit clone&lt;/code&gt;.
&lt;p&gt;We will want to start importing legacy uploads to git.
&lt;p&gt;Then downstreams and users will be able to get the source code for any package simply with &lt;code&gt;git clone&lt;/code&gt;, even if the maintainer is using legacy upload tools like dput.
&lt;h3&gt;&lt;a name="support-for-git-based-uploads-to-security.debian.org"&gt;Support for git-based uploads to security.debian.org&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Security patching is a task which would particularly benefit from better and more formal use of git. git-based approaches to applying and backporting security patches are much more convenient than messing about with actual patch files.
&lt;p&gt;Currently, one can use git to help prepare a security upload, but it often involves starting with a dsc import (which lacks the proper git history) or figuring out a package maintainer&amp;rsquo;s unstandardised git usage conventions on Salsa.
&lt;p&gt;And it is not possible to properly perform the security release &lt;em&gt;as git&lt;/em&gt;.
&lt;h3&gt;&lt;a name="internal-debian-consumers-switch-to-getting-source-from-git"&gt;Internal Debian consumers switch to getting source from git&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Buildds, QA work such as lintian checks, and so on, could be simpler if they don&amp;rsquo;t need to deal with source packages.
&lt;p&gt;And since git is actually the canonical form, we want them to use it directly.
&lt;h3&gt;&lt;a name="problems-for-the-distant-future"&gt;Problems for the distant future&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;For decades, Debian has been built around source packages. Replacing them is a long and complex process. Certainly source packages are going to continue to be supported for the foreseeable future.
&lt;p&gt;There are no doubt going to be unanticipated problems. There are also foreseeable issues: for example, perhaps there are packages that work very badly when represented in git. We think we can rise to these challenges as they come up.
&lt;h1&gt;&lt;a name="mindshare-and-adoption---please-help"&gt;Mindshare and adoption - please help!&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;We and our users are very pleased with our technology. It is convenient and highly dependable.
&lt;p&gt;&lt;code&gt;dgit&lt;/code&gt; in particular is superb, even if we say so ourselves. As technologists, we have been very focused on building good software, but it seems we have fallen short in the marketing department.
&lt;h2&gt;&lt;a name="a-rant-about-publishing-the-source-code"&gt;A rant about publishing the source code&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;git is the preferred form for modification&lt;/strong&gt;.
&lt;p&gt;Our upstreams are overwhelmingly using git. We are overwhelmingly using git. It is a scandal that for many packages, Debian does not properly, formally and officially publish the git history.
&lt;p&gt;&lt;em&gt;Properly&lt;/em&gt; publishing the source code as git means publishing it in a way that means that anyone can &lt;em&gt;automatically&lt;/em&gt; and &lt;em&gt;reliably&lt;/em&gt; obtain &lt;em&gt;and build&lt;/em&gt; the &lt;em&gt;exact&lt;/em&gt; source code corresponding to the binaries. The test is: could you use that to build a derivative?
&lt;p&gt;Putting a package &lt;a href="https://dep-team.pages.debian.net/deps/dep18/"&gt;in git on Salsa&lt;/a&gt; is often a good idea, but it is not sufficient. No standard branch structure git on Salsa is enforced, nor should it be (so it can&amp;rsquo;t be automatically and reliably obtained), the tree is not in a standard form (so it can&amp;rsquo;t be automatically built), and is not &lt;em&gt;necessarily identical&lt;/em&gt; to the source package. So &lt;code&gt;Vcs-Git&lt;/code&gt; fields, and git from Salsa, will never be sufficient to make a derivative.
&lt;p&gt;&lt;strong&gt;Debian is not publishing the source code!&lt;/strong&gt;
&lt;p&gt;The time has come for proper publication of source code by Debian to no longer be a minority sport. Every maintainer of a package whose upstream is using git (which is nearly all packages nowadays) should be basing their work on upstream git, and properly publishing that via tag2upload or dgit.
&lt;p&gt;And it&amp;rsquo;s not even difficult! The modern git-based tooling provides a far superior upload experience.
&lt;h3&gt;&lt;a name="a-common-misunderstanding"&gt;A common misunderstanding&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;dgit push is not an alternative to gbp pq or quilt. Nor is tag2upload.&lt;/strong&gt; These upload tools &lt;em&gt;complement your existing git workflow&lt;/em&gt;. They replace and improve source package building/signing and the subsequent dput. If you are using one of the usual git layouts on salsa, and your package is in good shape, you can adopt tag2upload and/or dgit push right away.
&lt;p&gt;&lt;code&gt;git-debrebase&lt;/code&gt; is distinct and &lt;em&gt;does&lt;/em&gt; provides an alternative way to manage your git packaging, do your upstream rebases, etc.
&lt;h2&gt;&lt;a name="documentation"&gt;Documentation&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Debian&amp;rsquo;s documentation all needs to be updated, including particularly instructions for packaging, to recommend use of git-first workflows. Debian should not be importing git-using upstreams&amp;rsquo; &amp;ldquo;release tarballs&amp;rdquo; into git. (Debian outsiders who discover this practice are typically horrified.) We should use &lt;em&gt;only&lt;/em&gt; upstream git, work only in git, and properly release (and publish) in git form.
&lt;p&gt;We, the git transition team, are experts in the technology, and can provide good suggestions. But we do not have the bandwidth to also engage in the massive campaigns of education and documentation updates that are necessary &amp;mdash; especially given that (as with any programme for change) many people will be sceptical or even hostile.
&lt;p&gt;So we would greatly appreciate help with writing and outreach.
&lt;h1&gt;&lt;a name="personnel"&gt;Personnel&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;We consider ourselves the Debian git transition team.
&lt;p&gt;Currently we are:
&lt;ul&gt;&lt;li&gt;&lt;p&gt;Ian Jackson. Author and maintainer of dgit and git-debrebase. Co-creator of tag2upload. Original author of dpkg-source, and inventor in 1996 of Debian Source Packages. Alumnus of the Debian Technical Committee.

&lt;li&gt;&lt;p&gt;Sean Whitton. Co-creator of the tag2upload system; author and maintainer of git-debpush. Co-maintainer of dgit. Debian Policy co-Editor. Former Chair of the Debian Technical Committee.

&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;We wear the following hats related to the git transition:
&lt;ul&gt;&lt;li&gt;Maintainers of src:dgit
&lt;li&gt;&lt;a href="https://lists.debian.org/debian-devel-announce/2025/01/msg00002.html"&gt;tag2upload Delegates&lt;/a&gt;; operators of the &lt;a href="https://tag2upload.debian.org/"&gt;tag2upload service&lt;/a&gt;.
&lt;li&gt;service operators of the git depository &lt;a href="https://browse.dgit.debian.org/"&gt;*.dgit.debian.org&lt;/a&gt;.
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;You can contact us:
&lt;ul&gt;&lt;li&gt;&lt;p&gt;By email: Ian Jackson &lt;a class="email" href="mailto:ijackson@chiark.greenend.org.uk"&gt;ijackson@chiark.greenend.org.uk&lt;/a&gt;; Sean Whitton &lt;a class="email" href="mailto:spwhitton@spwhitton.name"&gt;spwhitton@spwhitton.name&lt;/a&gt;; git-debpush@packages.d.o.

&lt;li&gt;&lt;p&gt;By filing bugs in the Debian Bug System against &lt;a href="https://bugs.debian.org/src:dgit"&gt;src:dgit&lt;/a&gt;.

&lt;li&gt;&lt;p&gt;On OFTC IRC, as &lt;code&gt;Diziet&lt;/code&gt; and &lt;code&gt;spwhitton&lt;/code&gt;.

&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;We do most of our heavy-duty development &lt;a href="https://salsa.debian.org/dgit-team"&gt;on Salsa&lt;/a&gt;.
&lt;h2&gt;&lt;a name="thanks"&gt;Thanks&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Particular thanks are due to Joey Hess, who, in the now-famous design session in Vaumarcus in 2013, helped invent dgit. Since then we have had a lot of support: most recently political support to help get tag2upload deployed, but also, over the years, helpful bug reports and kind words from our users, as well as translations and code contributions.
&lt;p&gt;Many other people have contributed more generally to support for working with Debian source code in git. We particularly want to mention Guido G&amp;uuml;nther (git-buildpackage); and of course Alexander Wirt, Joerg Jaspert, Thomas Goirand and Antonio Terceiro (Salsa administrators); and before them the Alioth administrators.&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=diziet&amp;ditemid=20436" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-21:377446:20143</id>
    <link rel="alternate" type="text/html" href="https://diziet.dreamwidth.org/20143.html"/>
    <link rel="self" type="text/xml" href="https://diziet.dreamwidth.org/data/atom/?itemid=20143"/>
    <title>tag2upload in the first month of forky</title>
    <published>2025-09-14T15:36:17Z</published>
    <updated>2025-09-14T15:36:41Z</updated>
    <category term="dgit"/>
    <category term="computers"/>
    <category term="debian"/>
    <category term="git"/>
    <category term="tag2upload"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">&lt;p&gt;tl;dr: &lt;a href="https://wiki.debian.org/tag2upload"&gt;tag2upload&lt;/a&gt; (beta) is going well so far, and is already handling around one in 13 uploads to Debian.
&lt;ul&gt;&lt;li&gt;&lt;a href="#introduction-and-some-stats"&gt;Introduction and some stats&lt;/a&gt;
&lt;li&gt;&lt;a href="#recent-uiux-improvements"&gt;Recent UI/UX improvements&lt;/a&gt;
&lt;li&gt;&lt;a href="#why-we-are-still-in-beta"&gt;Why we are still in beta&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="#retrying-on-salsa-side-failures"&gt;Retrying on Salsa-side failures&lt;/a&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;li&gt;&lt;a href="#other-notable-ongoing-work"&gt;Other notable ongoing work&lt;/a&gt;
&lt;li&gt;&lt;a href="#common-problems"&gt;Common problems&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="#reuse-of-version-numbers-and-attempts-to-re-tag"&gt;Reuse of version numbers, and attempts to re-tag&lt;/a&gt;
&lt;li&gt;&lt;a href="#discrepancies-between-git-and-orig-tarballs"&gt;Discrepancies between git and orig tarballs&lt;/a&gt;
&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;li&gt;&lt;a href="#get-involved"&gt;Get involved&lt;/a&gt;
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;a name="cutid1"&gt;&lt;/a&gt;
&lt;h3&gt;&lt;a name="introduction-and-some-stats"&gt;Introduction and some stats&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;We announced tag2upload&amp;rsquo;s open beta in mid-July. That was in the middle of the the freeze for trixie, so usage was fairly light until the forky floodgates opened.
&lt;p&gt;Since then the service has successfully performed &lt;strong&gt;637 uploads&lt;/strong&gt;, of which 420 were in the last 32 days. That&amp;rsquo;s an average of about 13 per day. For comparison, during the first half of September up to today there have been 2475 uploads to unstable. That&amp;rsquo;s about 176/day.
&lt;p&gt;So, tag2upload is already handling around 7.5% of uploads. This is very gratifying for a service which is advertised as still being in beta!
&lt;p&gt;Sean and I are very pleased both with the uptake, and with the way the system has been performing.
&lt;h3&gt;&lt;a name="recent-uiux-improvements"&gt;Recent UI/UX improvements&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;During this open beta period we have been hard at work. We have made many improvements to the user experience.
&lt;p&gt;Current &lt;code&gt;git-debpush&lt;/code&gt; in forky, or trixie-backports, is much better at detecting various problems ahead of time.
&lt;p&gt;When uploads do fail on the service the emailed error reports are now more informative. For example, anomalies involving orig tarballs, which by definition can&amp;rsquo;t be detected locally (since one point of tag2upload is not to have tarballs locally) now generally result in failure reports containing a diffstat, and instructions for a local repro.
&lt;h3&gt;&lt;a name="why-we-are-still-in-beta"&gt;Why we are still in beta&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;There are a few outstanding work items that we currently want to complete before we declare the end of the beta.
&lt;h4&gt;&lt;a name="retrying-on-salsa-side-failures"&gt;Retrying on Salsa-side failures&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;The biggest of these is that the service should be able to retry when Salsa fails. Sadly, Salsa isn&amp;rsquo;t wholly reliable, and right now if it breaks when the service is trying to handle your tag, your upload can fail.
&lt;p&gt;We think most of these failures could be avoided. Implementing retries is a fairly substantial task, but doesn&amp;rsquo;t pose any fundamental difficulties. We&amp;rsquo;re working on this right now.
&lt;h3&gt;&lt;a name="other-notable-ongoing-work"&gt;Other notable ongoing work&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;We want to support pristine-tar, so that pristine-tar users can do a new upstream release. Andrea Pappacoda is working on that with us. See &lt;a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1106071"&gt;#1106071&lt;/a&gt;. (Note that we would generally &lt;strong&gt;recommend against use of pristine-tar&lt;/strong&gt; within Debian. But we want to support it.)
&lt;p&gt;We have been having conversations with &lt;a href="https://salsa.debian.org/freexian-team/debusine"&gt;Debusine&lt;/a&gt; folks about what integration between tag2upload and Debusine would look like. We&amp;rsquo;re &lt;a href="https://salsa.debian.org/freexian-team/debusine/-/issues/815#note_651533"&gt;making some progress&lt;/a&gt; there, but a lot is still up in the air.
&lt;p&gt;&lt;a href="https://salsa.debian.org/salsa-ci-team/pipeline/-/issues/467#note_642152"&gt;We are considering&lt;/a&gt; how best to provide tag2upload pre-checks as part of Salsa CI. There are several problems detected by the tag2upload service that could be detected by Salsa CI too, but which can&amp;rsquo;t be detected by &lt;code&gt;git-debpush&lt;/code&gt;.
&lt;h3&gt;&lt;a name="common-problems"&gt;Common problems&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;We&amp;rsquo;ve been monitoring the service and until very recently we have investigated every service-side failure, to understand the root causes. This has given us insight into the kinds of things our users want, and the kinds of packaging and git practices that are common. We&amp;rsquo;ve been able to improve the system&amp;rsquo;s handling of various anomalies and also improved the documentation.
&lt;p&gt;Right now our failure rate is still rather high, at around 7%. Partly this is because people are trying out the system on packages that haven&amp;rsquo;t ever seen git tooling with such a level of rigour.
&lt;p&gt;There are two classes of problem that are responsible for the vast majority of the failures that we&amp;rsquo;re still seeing:
&lt;h4&gt;&lt;a name="reuse-of-version-numbers-and-attempts-to-re-tag"&gt;Reuse of version numbers, and attempts to re-tag&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;tag2upload, like git (and like &lt;code&gt;dgit&lt;/code&gt;), hates it when you reuse a version number, or try to pretend that a (perhaps busted) release never happened.
&lt;p&gt;git tags aren&amp;rsquo;t namespaced, and tend to spread about promiscuously. So replacing a signed git tag, with a different tag of the same name, is a bad idea. More generally, reusing the same version number for a different (signed!) package is poor practice. Likewise, it&amp;rsquo;s usually a bad idea to remove changelog entries for versions which were actually released, just because they were later deemed improper.
&lt;p&gt;We understand that many Debian contributors have gotten used to this kind of thing. Indeed, tools like &lt;code&gt;dcut&lt;/code&gt; encourage it. It does allow you to make things neat-looking, even if you&amp;rsquo;ve made mistakes - but really it does so by &lt;em&gt;covering up&lt;/em&gt; those mistakes!
&lt;p&gt;The bottom line is that tag2upload can&amp;rsquo;t support such history-rewriting. If you discover a mistake after you&amp;rsquo;ve signed the tag, please just &lt;strong&gt;burn the version number and add a new changelog stanza&lt;/strong&gt;.
&lt;p&gt;One bonus of tag2upload&amp;rsquo;s approach is that it will discover if you are accidentally overwriting an NMU, and report that as an error.
&lt;h4&gt;&lt;a name="discrepancies-between-git-and-orig-tarballs"&gt;Discrepancies between git and orig tarballs&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;tag2upload promises that the source package that it generates corresponds precisely to the git tree you tag and sign.
&lt;p&gt;Orig tarballs make this complicated. They aren&amp;rsquo;t present on your laptop when you &lt;code&gt;git-debpush&lt;/code&gt;. When you&amp;rsquo;re not uploading a new upstream version, the tag2upload service reuses existing orig tarballs from the archive. If your git and the archive&amp;rsquo;s orig don&amp;rsquo;t agree, the tag2upload service will report an error, rather than upload a package with contents that differ from your git tag.
&lt;p&gt;With the most common Debian workflows, everything is fine:
&lt;p&gt;If you base everything on upstream git, and make your orig tarballs with &lt;code&gt;git archive&lt;/code&gt; (or &lt;code&gt;git deborig&lt;/code&gt;), your orig tarballs are the same as the git, by construction. &lt;strong&gt;We recommend usually ignoring upstream tarballs&lt;/strong&gt;: most upstreams work in git, and their tarballs can contain weirdness that we don&amp;rsquo;t want. (At worst, the tarball can contain an attack that isn&amp;rsquo;t visible in git, as with &lt;code&gt;xz&lt;/code&gt;!)
&lt;p&gt;Alternatively, if you use &lt;code&gt;gbp import-orig&lt;/code&gt;, the differences (including an attack like Jia Tan&amp;rsquo;s) are &lt;em&gt;imported into&lt;/em&gt; git for you. Then, once again, your git and the orig tarball will correspond.
&lt;p&gt;But there are other workflows where this correspondence may not hold. Those workflows are hazardous, because the thing you&amp;rsquo;re probably working with locally for your routine development is the git view. Then, when you upload, your work is transplanted onto the orig tarball, which might be quite different - so what you upload isn&amp;rsquo;t what you&amp;rsquo;ve been working on!
&lt;p&gt;This situation is detected by tag2upload, precisely because tag2upload checks that it&amp;rsquo;s keeping its promise: the source package is identical to the git view. (&lt;code&gt;dgit push&lt;/code&gt; makes the same promise.)
&lt;h3&gt;&lt;a name="get-involved"&gt;Get involved&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Of course the easiest way to get involved is to &lt;a href="https://wiki.debian.org/tag2upload"&gt;start using tag2upload&lt;/a&gt;.
&lt;p&gt;We would love to have more contributors. There are some easy tasks to get started with, in &lt;a href="https://bugs.debian.org/cgi-bin/pkgreport.cgi?src=dgit;tag=newcomer"&gt;bugs we&amp;rsquo;ve tagged &amp;ldquo;newcomer&amp;rdquo;&lt;/a&gt; &amp;mdash; mostly UX improvements such as detecting certain problems earlier, in &lt;code&gt;git-debpush&lt;/code&gt;.
&lt;p&gt;More substantially, we are looking for help with &lt;code&gt;sbuild&lt;/code&gt;: we&amp;rsquo;d like it to be able to work directly from git, rather than needing to build source packages: &lt;a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=868527"&gt;#868527&lt;/a&gt;.&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=diziet&amp;ditemid=20143" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-21:377446:17579</id>
    <link rel="alternate" type="text/html" href="https://diziet.dreamwidth.org/17579.html"/>
    <link rel="self" type="text/xml" href="https://diziet.dreamwidth.org/data/atom/?itemid=17579"/>
    <title>Don’t use apt-get source; use dgit</title>
    <published>2023-12-04T15:10:52Z</published>
    <updated>2023-12-04T15:12:25Z</updated>
    <category term="computers"/>
    <category term="debian"/>
    <category term="dgit"/>
    <dw:security>public</dw:security>
    <dw:reply-count>1</dw:reply-count>
    <content type="html">&lt;p&gt;tl;dr:
&lt;p&gt;If you are a Debian user who knows git, &lt;strong&gt;don&amp;rsquo;t work with Debian source packages&lt;/strong&gt;. Don&amp;rsquo;t use &lt;code&gt;apt source&lt;/code&gt;, or &lt;code&gt;dpkg-source&lt;/code&gt;. Instead, &lt;strong&gt;use &lt;a href="https://manpages.debian.org/stable/dgit/dgit-user.7.en.html"&gt;dgit&lt;/a&gt; and work in git&lt;/strong&gt;.
&lt;p&gt;Also, &lt;strong&gt;don&amp;rsquo;t&lt;/strong&gt; use: &amp;ldquo;VCS&amp;rdquo; links on official Debian web pages, &lt;code&gt;debcheckout&lt;/code&gt;, or Debian&amp;rsquo;s (semi-)official gitlab, Salsa. These are suitable for Debian experts only; for most people they &lt;a href="https://diziet.dreamwidth.org/9556.html"&gt;can be beartraps&lt;/a&gt;. Instead, use &lt;a href="https://manpages.debian.org/stable/dgit/dgit-user.7.en.html"&gt;dgit&lt;/a&gt;.
&lt;ul&gt;&lt;li&gt;&lt;a href="#struggling-with-debian-source-packages"&gt;Struggling with Debian source packages?&lt;/a&gt;
&lt;li&gt;&lt;a href="#just-use-dgit"&gt;Just use dgit&lt;/a&gt;
&lt;li&gt;&lt;a href="#objections"&gt;Objections&lt;/a&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="#but-i-dont-want-to-learn-yet-another-tool"&gt;But I don&amp;rsquo;t want to learn &lt;em&gt;yet another&lt;/em&gt; tool&lt;/a&gt;
&lt;li&gt;&lt;a href="#shouldnt-i-be-using-official-debian-git-repos"&gt;Shouldn&amp;rsquo;t I be using &amp;ldquo;official&amp;rdquo; Debian git repos?&lt;/a&gt;
&lt;li&gt;&lt;a href="#gosh-is-debian-really-this-bad"&gt;Gosh, is Debian really this bad?&lt;/a&gt;
&lt;li&gt;&lt;a href="#im-a-debian-maintainer.-you-tell-me-dgit-is-something-totally-different"&gt;I&amp;rsquo;m a Debian maintainer. You tell &lt;em&gt;me&lt;/em&gt; dgit is something totally different!&lt;/a&gt;
&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;

&lt;/li&gt;&lt;/li&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;a name="cutid1"&gt;&lt;/a&gt;&amp;gt;
&lt;h3&gt;&lt;a name="struggling-with-debian-source-packages"&gt;Struggling with Debian source packages?&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;A friend of mine recently asked for help on IRC. They&amp;rsquo;re an experienced Debian administrator and user, and were trying to: make a change to a Debian package; build and install and run binary packages from it; and record that change for their future self, and their colleagues. They ended up trying to comprehend quilt.
&lt;p&gt;&lt;a href="https://manpages.debian.org/bookworm/quilt/quilt.1.en.html"&gt;quilt&lt;/a&gt; is an ancient utility for managing sets of source code patches, from well before the era of modern version control. It has many strange behaviours and footguns. Debian&amp;rsquo;s ancient and obsolete tarballs-and-patches &lt;a href="https://manpages.debian.org/bookworm/dpkg-dev/dpkg-source.1.en.html"&gt;source package format&lt;/a&gt; (which I designed the initial version of in 1993) nowadays uses quilt, at least for most packages.
&lt;p&gt;You don&amp;rsquo;t want to deal with any of this nonsense. You don&amp;rsquo;t want to learn quilt, and suffer its misbehaviours. You don&amp;rsquo;t want to learn about Debian source packages and wrestle dpkg-source.
&lt;p&gt;Happily, you don&amp;rsquo;t need to.
&lt;h3&gt;&lt;a name="just-use-dgit"&gt;Just use dgit&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;One of dgit&amp;rsquo;s main objectives is to minimise the amount of Debian craziness you need to learn. dgit aims to empower you to make changes to the software you&amp;rsquo;re running, conveniently and with a minimum of fuss.
&lt;p&gt;You can use dgit to get the source code to a Debian package, as a git tree, with &lt;code&gt;dgit clone&lt;/code&gt; (and &lt;code&gt;dgit fetch&lt;/code&gt;). The git tree can be made into a binary package directly.
&lt;p&gt;The only things you really need to know are:
&lt;ol type="1"&gt;&lt;li&gt;&lt;p&gt;By default dgit fetches from Debian unstable, the main work-in-progress branch. You may want something like &lt;code&gt;dgit clone PACKAGE bookworm,-security&lt;/code&gt; (yes, with a comma).

&lt;li&gt;&lt;p&gt;You probably want to edit &lt;code&gt;debian/changelog&lt;/code&gt; to make your packages have a different version number.

&lt;li&gt;&lt;p&gt;To build binaries, run &lt;code&gt;dpkg-buildpackage -uc -b&lt;/code&gt;.

&lt;li&gt;&lt;p&gt;Debian package builds are often disastrously messsy: builds might modify source files; and the official &lt;code&gt;debian/rules clean&lt;/code&gt; can be inadequate, or crazy. Always commit before building, and use &lt;code&gt;git clean&lt;/code&gt; and &lt;code&gt;git reset --hard&lt;/code&gt; instead of running clean rules from the package.

&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;Don&amp;rsquo;t try to make a Debian source package. (Don&amp;rsquo;t read the &lt;code&gt;dpkg-source&lt;/code&gt; manual!) Instead, to preserve and share your work, use the git branch.
&lt;p&gt;&lt;code&gt;dgit pull&lt;/code&gt; or &lt;code&gt;dgit fetch&lt;/code&gt; can be used to get updates.
&lt;p&gt;There is a more comprehensive tutorial, with example runes, in the &lt;a href="https://manpages.debian.org/stable/dgit/dgit-user.7.en.html"&gt;dgit-user(7)&lt;/a&gt; manpage. (There is of course &lt;a href="https://manpages.debian.org/bookworm/dgit/dgit.1.en.html"&gt;complete reference documentation&lt;/a&gt;, but you don&amp;rsquo;t need to bother reading it.)
&lt;h3&gt;&lt;a name="objections"&gt;Objections&lt;/a&gt;&lt;/h3&gt;
&lt;h4&gt;&lt;a name="but-i-dont-want-to-learn-yet-another-tool"&gt;But I don&amp;rsquo;t want to learn &lt;em&gt;yet another&lt;/em&gt; tool&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;One of dgit&amp;rsquo;s main goals is to save people from learning things you don&amp;rsquo;t need to. It aims to be straightforward, convenient, and (so far as Debian permits) unsurprising.
&lt;p&gt;So: don&amp;rsquo;t &lt;em&gt;learn&lt;/em&gt; dgit. Just run it and it will be fine :-).
&lt;h4&gt;&lt;a name="shouldnt-i-be-using-official-debian-git-repos"&gt;Shouldn&amp;rsquo;t I be using &amp;ldquo;official&amp;rdquo; Debian git repos?&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Absolutely not.&lt;/strong&gt;
&lt;p&gt;Unless you are a Debian expert, these can be terrible beartraps. One possible outcome is that you might build an apparently working program &lt;em&gt;but without the security patches&lt;/em&gt;. Yikes!
&lt;p&gt;I discussed this in more detail in 2021 in &lt;a href="https://diziet.dreamwidth.org/9556.html"&gt;another blog post plugging dgit&lt;/a&gt;.
&lt;h4&gt;&lt;a name="gosh-is-debian-really-this-bad"&gt;Gosh, is Debian really this bad?&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Yes. On behalf of the Debian Project, I apologise.
&lt;p&gt;Debian is a very conservative institution. Change usually comes very slowly. (And when rapid or radical change has been forced through, the results haven&amp;rsquo;t always been pretty, either technically or socially.)
&lt;p&gt;Sadly this means that sometimes much needed change can take a very long time, if it happens at all. But this tendency also provides the stability and reliability that people have come to rely on Debian for.
&lt;h4&gt;&lt;a name="im-a-debian-maintainer.-you-tell-me-dgit-is-something-totally-different"&gt;I&amp;rsquo;m a Debian maintainer. You tell &lt;em&gt;me&lt;/em&gt; dgit is something totally different!&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;dgit is, in fact, a general bidirectional gateway between the Debian archive and git.
&lt;p&gt;So yes, dgit is also a tool for Debian uploaders. You should use it to do your uploads, whenever you can. It&amp;rsquo;s more convenient and more reliable than &lt;code&gt;git-buildpackage&lt;/code&gt; and &lt;code&gt;dput&lt;/code&gt; runes, and produces better output for users. You too can start to forget how to deal with source packages!
&lt;p&gt;A full treatment of this is beyond the scope of this blog post.&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=diziet&amp;ditemid=17579" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2009-05-21:377446:9556</id>
    <link rel="alternate" type="text/html" href="https://diziet.dreamwidth.org/9556.html"/>
    <link rel="self" type="text/xml" href="https://diziet.dreamwidth.org/data/atom/?itemid=9556"/>
    <title>Get source to Debian packages only via dgit; "official" git links are beartraps</title>
    <published>2021-09-15T12:17:34Z</published>
    <updated>2021-09-15T14:57:58Z</updated>
    <category term="dgit"/>
    <category term="debian"/>
    <category term="computers"/>
    <dw:security>public</dw:security>
    <dw:reply-count>4</dw:reply-count>
    <content type="html">&lt;h2&gt;tl;dr&lt;/h2&gt;
&lt;p&gt;

&lt;strong&gt;&lt;code&gt;dgit clone sourcepackage&lt;/code&gt;&lt;/strong&gt; gets you the source code, as a git tree, in &lt;code&gt;./sourcepackage&lt;/code&gt;.  cd into it and &lt;code&gt;dpkg-buildpackage -uc -b&lt;/code&gt;.

&lt;p&gt;
&lt;strong&gt;Do not use&lt;/strong&gt;: "VCS" links on official Debian web pages like tracker.debian.org; "debcheckout"; searching Debian's gitlab (salsa.debian.org).  These are good for Debian experts only.

&lt;p&gt;
If you use Debian's "official" source git repo links you can easily build a package without Debian's patches applied.&lt;a href="#footnote-1"&gt;[1]&lt;/a&gt;
This can even mean missing security patches.  Or maybe it can't even be built in a normal way (or at all).

&lt;h2&gt;OMG WTF BBQ, why?&lt;/h2&gt;
&lt;p&gt;
It's complicated.  There is History.

&lt;p&gt;
Debian's "most-official" centralised source repository is still the Debian Archive,
which is a system based on tarballs and patches.  I invented the Debian source package format in 1992/3 and it has been souped up since, but it's still tarballs and patches.
This system is, of course, obsolete, now that we have modern version control systems, especially git.

&lt;p&gt;
Maintainers of Debian packages have invented ways of using git anyway, of course.
But this is not standardised.
There is a &lt;a href="https://wiki.debian.org/GitPackagingSurvey"&gt;bewildering array&lt;/a&gt; of approaches.

&lt;p&gt;
The most common approach is to maintain git tree containing a pile of &lt;code&gt;*.patch&lt;/code&gt; files,
which are then often maintained using quilt.  Yes, really, many Debian people are still using quilt,
despite having git!  There is machinery for converting this git tree containing a series of patches, to an "official" source package.  If you don't use that machinery, and just build from git, nothing applies the patches.

&lt;p&gt;
&lt;a name="footnote-1"&gt;[1]&lt;/a&gt;
This post was prompted by a conversation with a friend who had wanted to build a Debian package,
and didn't know to use dgit.  They had
got the source from salsa via a link on tracker.d.o, and built &lt;code&gt;.deb&lt;/code&gt;s without Debian's patches.
This not a theoretical unsoundness, but a very real practical risk.

&lt;h2&gt;Future is not very bright&lt;/h2&gt;
&lt;p&gt;
In 2013 at the Debconf in Vaumarcus, Joey Hess, myself, and others, came up with a plan to try to improve this which we thought would be deployable.  (Previous attempts had failed.)
Crucially, this transition plan does not force change onto any of Debian's many packaging teams,
nor onto people doing cross-package maintenance work.
I worked on this for quite a while, and at a technical level it is a resounding success.

&lt;p&gt;


&lt;p&gt;
Unfortunately there is a big limitation.  At the current stage of the transition, to work at its best, this replacement scheme hopes that maintainers who update a package will use a new upload tool.  The new tool fits into their existing Debian git packaging workflow and has some benefits, but it does make things more complicated rather than less (like any transition plan must, during the transitional phase).  When maintainers don't use this new tool, the standardised git branch seen by users is a compatibility stub generated from the tarballs-and-patches.  So it has the right contents, but useless history.

&lt;p&gt;
The next step is to &lt;a href="https://spwhitton.name/blog/entry/tag2upload/"&gt;allow a maintainer to update a package without dealing with tarballs-and-patches at all&lt;/a&gt;.  This would be massively more convenient for the maintainer, so an easy sell.  And of course it links the tarballs-and-patches to the git history in a proper machine-readable way.

&lt;p&gt;
We held a "git packaging requirements-gathering session" at the Curitiba Debconf in 2019.  I think the DPL's intent was to try to get input into the git workflow design problem.  The session was a great success: my existing design was able to meet nearly everyone's needs and wants.  The room was obviously keen to see progress.  The next stage was to deploy tag2upload.  I spoke to various key people at the Debconf and afterwards in 2019 and the code has been basically ready since then.

&lt;p&gt;
Unfortunately, deployment of tag2upload is mired in politics.  It was blocked by a key team because of unfounded security concerns; positive opinions from independent security experts within Debian were disregarded.  Of course it is always hard to get a team to agree to something when it's part of a transition plan which treats their systems as an obsolete setup retained for compatibility.

&lt;h2&gt;Current status&lt;/h2&gt;

&lt;p&gt;
If you don't know about Debian's git packaging practices (eg, you have no idea what "patches-unapplied packaging branch without .pc directory" means), and don't want want to learn about them, you &lt;strong&gt;must&lt;/strong&gt; use &lt;code&gt;dgit&lt;/code&gt; to obtain the source of Debian packages.
There is a lot more information and detailed instructions in &lt;a href="https://manpages.debian.org/stable/dgit/dgit-user.7.en.html"&gt;&lt;code&gt;dgit-user(7)&lt;/code&gt;&lt;/a&gt;.

&lt;p&gt;
Hopefully either the maintainer did the best thing, or, if they didn't, you won't need to inspect the history.
If you are a Debian maintainer, you should use &lt;code&gt;dgit push-source&lt;/code&gt; to do your uploads.
This will make sure that users of dgit will see a reasonable git history.

&lt;address&gt;edited 2021-09-15 14:48 Z to fix a typo&lt;/address&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=diziet&amp;ditemid=9556" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
</feed>
