Tuesday 11 August 2020

Adopting into VCS uploads made to Ubuntu without VCS

I wrote a quick tool that might be useful to others.

If you maintain packaging in git directly, then you've probably had to
deal with uploads happening directly to the archive without the
relevant commits landing in your "package maintainer" git repository.

With this tool catching up is now just a case of:

$ git fetch pkg
$ adopt.py pkg/ubuntu/devel

Here's where the tool is kept for now:

https://git.launchpad.net/~ubuntu-server/ubuntu-helpers/tree/rbasak/adopt.py

My understanding of current Ubuntu developer etiquette is that while
it's polite for uploaders to follow Vcs-Git and push to that repository
or send an appropriate request first, this isn't always practical for
various reasons, so we do end up getting "NMUs" from time to time.

In my case this keeps happening to src:mysql-8.0 while I'm also trying
to maintain a gbp workflow in Salsa.

Because git-ubuntu is also maintaining a view on the archive state of
src:mysql-8.0, I can take advantage of that to save myself some effort.
Note that this isn't a case of "adopting" git-ubuntu; it's just making
use of the git-ubuntu repository that exists as a view on to the
archive.

A cherry-pick isn't always sufficient because I need a merge commit to
land in the Salsa VCS so as not to break the next upstream release I
want to adopt using the gbp workflow. So this tool also supports
constructing that merge commit with "-p". See the comments at the top of
the script for details.

Maybe this should eventually end up part of git-ubuntu itself, but for
now it's a quick hack as a separate script.

HTH,

Robie