[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: git branches vs debian specific git tools (Re: RFC for changes regarding NMU in developers reference



> > >> debian/README.source as described in the developers-reference.
> > >
> > > It would be great also to have an easy way to cherry peak from the upstream
> > > git repository in order to prepare patch series.
> > >
> > > Do we have a tool around DEP-14, which allows this ?
> >
> > Well, git-debrebase does, and is as compliant with DEP-14 as you'd like
> > it to be.
>
> There is gbp pq, which is probably more widely used.

Using gbp pq is easy, and it is also backwards compatible with quilt,
and automatically uses DEP-3 headers. Unfortunately as is with many
tools in Debian, the docs and man pages don't tell you clearly how to
do this fairly common operation of cherry-picking upstream commits
(https://manpages.debian.org/unstable/git-buildpackage/gbp-pq.1.en.html).
My blog post https://optimizedbyotto.com/post/debian-source-package-git/#managing-patches-with-gbp-pq
hopefully helps, and it also has a diagram to help grasp how the
branches and commits go.

First run `gbp pq switch --force` to jump from regular source package
(e.g. debian/latest) branch to the special patch-queue/debian/latest
branch, where everything from debian/patches/* has automatically been
converted into commits. In this mode you can modify upstream code, git
cherry-pick, rebase and whatever you want. When done, run `gbp pq
export --drop --commit` to switch back to regular branch and note how
the files in debian/patches/* got updated. The end result is fully
backwards compatible with how Debian source packages work and upstream
sources stay intact and compatible with pristine-tar.

I wish somebody would have taught me `gbp pq` 10 years ago. It would
have saved me so much time I wsted fiddling with quilt/dquilt...


Reply to: