summaryrefslogtreecommitdiff
path: root/development/debian_packages_in_git.mdwn
blob: 5111cb6763de2146139710715030388aefb75adb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
## keeping debian/patches on a patch-queue branch
I'm keeping all patches for a Debian package that is maintained on branch *foo* on a patch-queue branch *patch-queue/foo* since:

* one can easily work with the unpatched (*foo*) and patched (*patch-queue/foo*) branches
* patches can easily be dropped, added by modifying the patch-queue branch (no messing with *quilt add*, *dpatch-edit-patch*, *cdbs-edit-patch* or the like)
* easy cherry-picking of patches for stable releases, etc.
* easy forward porting of patches to new upstream versions by using *git rebase* on the *patch-queue/foo* branch (patches already applied upatream are detected automatically).
* the generated patch in *debian/patches/* has all the necessary information to forward it upstream since it's auto generated via *git-format-patch*.

Disadvantage:

* no history on the *patch-queue/foo* branch, but you do have the history on *foo* of course. 

### Workflow:
Assuming the Debian source package has it's patches in *debian/patches* and these are parseable by *git-guiltimport(1)*:

* create *patch-queue* branch and import *debian/patches* onto it using [gbp-pq](http://honk.sigxcpu.org/projects/git-buildpackage/gbp-pq):

        cd $REPO
        gbp-pq import

* work an patch-queue branch (add, remove, rebase, test)
* switch back to master:

        git checkout master

* regenerate the patches in *debian/patches/* using [gbp-pq](http://honk.sigxcpu.org/projects/git-buildpackage/gbp-pq):

        gbp-pq export

* commit the result
* update *debian/changelog* (e.g. by running "git-dch -S -a")
* build the package
* after importing a new upstream version you can use the following commands to refresh *debian/patches*:

        gbp-pq rebase
        git checkout master
        gbp-pq export

### Team maintenance
The easiest way is to not push out any patch-queue/* branches at all. They can be recreated by any team member easily by using

    git branch -d patch-queue/master
    gbp-pq import

However you *can* push out patch-queue branches. Other team members must just be aware that that branches in the *patch-queue/* namespace are being rebased frequently.