After some internal bikeshedding, we decided to rework the tooling that the Server Team has been working on for git-based source package management. The old tool was
usd (Ubuntu Server Dev), as it stemmed from a Canonical Server sprint in Barcelona last year. That name is confusing (acronyms that aren’t obvious are never good) and really the tooling had evolved to be a
So, we renamed everything to be
git is awesome, that means
git ubuntu also works as long as
git-ubuntu is in your
$PATH. The snap (previously
usd-nacc) has been deprecated in favor of
git-ubuntu (it still exists, but if you try to run, e.g.,
usd-nacc.usd you are told to install the
git-ubuntu snap). To get it, use:
sudo snap install --classic git-ubuntu
We are working on some relatively big changes to the code-base to release next week:
- Empty directory support (LP: #1687057). My colleague Robie Basak implemented a workaround for upstream
git not being able to represent empty directories.
- Standardizing (internal to the code) how the remote(s) work and what refspecs are used to fetch from them.
Along with those architectural changes, one big functional shift is to using
git-config to store some metadata about the user (specifically, the Launchpad user name to use, in
~/.gitconfig) and the command used to create the repository (specifically, the source package name, in
<dir>/.git/config). I think this actually ends up being quite clean from an end-user perspective, and it means our APIs and commands are easier to use, as we can just lookup this information from
git-config when using an existing repository.
As always, the latest code is at: https://git.launchpad.net/usd-importer
This is the first in a series of posts about the Ubuntu Server Team’s git importer (
usd). There is a lot to discuss: why it’s necessary, the algorithm, using the tooling for doing merges, using the tooling for contributing one-off fixes, etc. But for this post, I’m just going to give a quick overview of what’s available and will follow-up in future posts with those details.
The importer was first announced here and then a second announcement was made here. But both those posts are pretty out-of-date now… I have written a relatively current guide to merging which does talk about the tooling here, and much of that content will be re-covered in future blog posts.
The tooling is browse-able here and can be obtained via
git clone https://git.launchpad.net/usd-importer
This will provide a
usd command in the local repository’s
bin directory. That command resembles
git as being the launching point for interacting with imported trees — both for importing them and for using them:
usage: usd [-h] [-P PARENTFILE] [-L PULLFILE]
Ubuntu Server Dev git tool
build - Build a usd-cloned tree with dpkg-buildpackage
build-source - Build a source package and changes file
clone - Clone package to a directory
import - Update a launchpad git tree based upon the state of the Ubuntu and Debian archives
merge - Given a usd-import'd tree, assist with an Ubuntu merge
tag - Given a usd-import'd tree, tag a commit respecting DEP14
More information is available at https://wiki.ubuntu.com/UbuntuDevelopment/Merging/GitWorkflow.
You can run
usd locally without arguments to view the full help.
Imported trees currently live here. This will probably change in the future as we work with the Launchpad team to integrate the functionality. As you can see, we have 411 repositories currently (as of this post) and that’s a consequence of having the importer running automatically. Every 20 minutes or so, the
usd-cron script checks if there are any new publishes of source packages listed in
usd-cron-packages.txt in Debian or Ubuntu and runs
usd import on them, if so.
I think that’s enough for the first post! Just browsing the code and the imported trees is pretty interesting (running
gitk on an imported repository gives you a very interesting visual of Ubuntu development). I’ll dig into details in the next post (probably of many).