A (git) workflow for Debian packaging

Pierre Habouzit madcoder at debian.org
Fri Oct 5 15:32:32 UTC 2007


On Fri, Oct 05, 2007 at 03:20:24PM +0000, Pierre Habouzit wrote:
>   Ver0                                   Ver1
> ---O---o---o---o---o---o---o---o---o---o---O---o---o---> (upstream)
>    |
>    \
>     p---p---p---p---p---p---p---p (patches)
>             |               |    \___
>              \               \       \
> --x---x---x---x---x---x---x---x---x---X---x---x---x---> (debian)
>                                    Ver0-3
> [...]
>
>   When I intend to package a new upstream (Ver1) or even an intermediate
> snapshot, it does not matter, I go in the "patches" branch, and I:
> 
>   % git rebase --onto Ver1 Ver0 patches
>
> [...]
>
> cherry-picks will do that), or if upstream integrated a slightly
> different one, you'll get conflicts to resolve (that's life).

  If the rebase is too hard, e.g. because upstream did a _lot_ of
changes, you can rebase incrementally e.g. rebasing --onto intermediary
commits. It helps having smaller steps, with less conflicts. And you
rebase --onto one that is nearer and nearer to Ver1.

  Another way is that you can rebase "patches" bits by bits. E.g. you
can `rebase -i` your "patches" branch first, to reorder it (the order is
more or less chronological, and you don't really want to redo the
"patches" history for a new debian revision, if you didn't changed your
upstream, but stricto sensu you can). After having put "first" the easy
topics, you can rebase them away, e.g. in a separate topic branch. Then
you can deal with the rest of the patches and so on.

  This way having a quite big "patches" branch should not be scary (it
can happens if you end up patching upstream a lot, and that you didn't
foresee it).

  in fact, the moral of this story is that I believe that people don't
always understand that "git rebase" can be used as a "cherry-picker of
commits ranges", as soon as those commits ranges have no merge-commits
in it.

-- 
·O·  Pierre Habouzit
··O                                                madcoder at debian.org
OOO                                                http://www.madism.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/vcs-pkg-discuss/attachments/20071005/fa07ee08/attachment.pgp 


More information about the vcs-pkg-discuss mailing list