How to merge manually

In case the regular git-ubuntu-based Merge process fails, follow these instructions to perform the merge manually.

Merging series

The article series provides guidance on performing package merges.

Process overview:
How to do a merge:
  1. Preliminary steps

  2. Merge process

  3. Fix the changelog

  4. Upload a PPA

  5. Test the new build

  6. Submit Merge Proposal

Extra:

Generate the merge branch

Create a branch to do the merge work in:

$ git checkout -b merge-lp1802914-disco

Create tags

Tag

Source

old/ubuntu

ubuntu/<Ubuntu_release>-devel

old/debian

Last import tag prior to old/ubuntu without ubuntu suffix in version

new/debian

debian/sid

As per Debian releases, debian/sid always matches Debian “unstable”.

Find the last import tag using git log:

git log | grep "tag: pkg/import" | grep -v ubuntu | head -1

commit 9c3cf29c05c3fddd7359e71c978ff9a9a76e4404 (tag: pkg/import/3.1.20-3.1)

Based on that, create the following tags:

$ git tag old/ubuntu pkg/ubuntu/disco-devel
$ git tag old/debian 9c3cf29c05c3fddd7359e71c978ff9a9a76e4404
$ git tag new/debian pkg/debian/sid

Start a rebase

$ git rebase -i old/debian

Clear any history, up to and including the last Debian version

Clear any history, up to and including the last Debian version. If the package hasn’t been updated since the Git repository structure changed, it grabs all changes throughout time rather than since the last Debian version. Delete the older lines from the interactive rebase.

In this case, up to, and including the import of 3.1.20-3.1.

Create reconstruct tag

$ git ubuntu tag --reconstruct

Next step: Split commits.

Create logical tag manually

Use the version number of the last ubuntu change. So, if there are:

  • 3.1.20-3.1ubuntu1

  • 3.1.20-3.1ubuntu2

  • 3.1.20-3.1ubuntu2

Run:

$ git tag -a -m "Logical delta of 3.1.20-3.1ubuntu2" logical/3.1.20-3.1ubuntu2

Note

Certain characters aren’t allowed in Git. For example, replace colons (:) with percentage signs (%).

Next step: Rebase onto new Debian.

Finish the merge manually

  1. Merge the changelogs of old Ubuntu and new Debian:

    $ git show new/debian:debian/changelog > /tmp/debnew.txt
    $ git show old/ubuntu:debian/changelog > /tmp/ubuntuold.txt
    $ merge-changelog /tmp/debnew.txt /tmp/ubuntuold.txt > debian/changelog
    $ git commit -m "Merge changelogs" debian/changelog
    
  2. Create a new changelog entry for the merge:

    $ dch -i
    

    Which creates, for example:

    at (3.1.23-1ubuntu1) disco; urgency=medium
    
    * Merge with Debian unstable (LP: #1802914). Remaining changes:
        - Suggest an MTA rather than Recommending one.
    
    -- Karl Stenerud <[email protected]>  Mon, 12 Nov 2018 18:11:53 +0100
    
  3. Commit the changelog:

    $ git commit -m "changelog: Merge of 3.1.23-1" debian/changelog
    
  4. Update maintainer:

    $ update-maintainer
    $ git commit -m "Update maintainer" debian/control
    

Next step: Fix the changelog

Get the orig tarball manually

Use the pristine-tar(1) tool to regenerate the orig (upstream) tarball:

  1. Create a new branch for the orig tarball:

    $ git checkout -b pkg/importer/debian/pristine-tar
    
  2. Regenerate the pristine tarball:

    $ pristine-tar checkout at_3.1.23.orig.tar.gz
    
  3. Switch to the merge branch:

    $ git checkout merge-3.1.23-1-disco
    

    TODO: Is this ^ branch name correct?

If git checkout also fails

$ git checkout merge-lp1802914-disco
$ cd /tmp
$ pull-debian-source at
$ mv at_3.1.23.orig.tar.gz{,.asc} ~/work/packages/ubuntu/
$ cd -

TODO: This step needs context/explanation.

Next step: Check the source for errors.

Submit merge proposal manually

$ git push kstenerud merge-lp1802914-disco

Then create a MP manually in Launchpad, and save the URL.

Next step: Update the merge proposal.