On Fri, Feb 28, 2020 at 12:10 AM Martina Ferrari <[email protected]> wrote: [...] > > And, dh-make-golang will tell you how to update the package too. > > The instruction is to `gbp import-orig --sign-tags --uscan > > --upstream-vcs-tag=<commit-ish>` > > gbp will do the work for you, like > > + merging upstream history on upstream branch > > + comparing the orig tarball which may exclude vendor directory, and > > generating a merging commit in upstream branch. > > + create upstream/* tags > > Unless I am mistaken, this does something completely different to what I > would expect: it will fetch a tarball and use it to update the upstream > branch, which will then have the actual commit as a parent. That is not > the same as keeping upstream history, in fact it will make it a lot more > complicated to analyse upstream history. This is a showstopper for me, > and renders much of the new workflow ideas useless.. >
Probably I can't understand what you mean. Have you tried the gbp command? I try to find a simple package to describe how it works. So I take this https://salsa.debian.org/go-team/packages/golang-k8s-sigs-yaml This package is packaged with dh-make-golang make -type=l -git_revision=v1.1.0 sigs.k8s.io/yaml You can look the tags debian/1.1.0 and upstream/1.1.0 In v1.0.0 upstream doesn't have a vendor directory, so we don't need to change upstream branch. But there's an empty commit in upstream branch. https://salsa.debian.org/go-team/packages/golang-k8s-sigs-yaml/-/commit/a8fcb1675594be83927bce4ce79710fd7c687fed (I don't know why need this empty commit, but it doesn't look bad.) Just now I find it has released v1.2.0, which contains a vendor directory, which means we need to repack. So I first tell uscan to exclude vendor in d/copyright. https://salsa.debian.org/go-team/packages/golang-k8s-sigs-yaml/-/commit/a65181698f48c407b13a9b4c026eb71bfc46b8f1 Then run 1. git fetch k8s-sigs(This is the upstream remote name which dh-make-golang adds) 2. gbp import-orig --uscan --upstream-vcs-tag=v1.2.0 I have pushed changes to salsa, you can see it there. Since the upstream branch should remove the vendor directory, gbp does this in a merge commit. The magic can be figured out when run `git show -m upstream/1.2.0`, in the second half of the output. `commit 3ca3bca8f75e2cff4fce2a53fa259c47c253ff02 (from 9fc95527decd95bb9d28cc2eab08179b2d0f6971) (tag: upstream/1.2.0, origin/upstream, upstream)` I think this works like a charm, and it looks great. And importantly the upstream history has been kept as it is. I know you and others may have other methods to maintain the upstream branch when you need to repack upstream source. But I find this gbp command is the simplest way to archive the goal(keep the upstream history). 1. Still works with d/copyright Files-Excluded field. 2. One command. -- Shengjing Zhu
