chiark / gitweb /
update workflow to use tg-export debian/rules target
[topgit.git] / debian / README.source
1 Building topgit for Debian
2 --------------------------
3
4 The topgit source package uses quilt to apply and remove its patches. Please
5 refer to /usr/share/doc/quilt/README.source for information about how to use
6 quilt for source packages.
7
8 The quilt series is, however, generated from the Git repository, using TopGit
9 itself. While subject to change, this currently happens as follows. Please
10 make sure to have the latest version of TopGit (>= 0.5) installed before
11 trying this:
12
13 1. Cloning the repository
14 ~~~~~~~~~~~~~~~~~~~~~~~~~
15 Cloning a TopGit repository requires an additional step to normal Git cloning:
16
17 1. git clone ssh://git.debian.org/git/collab-maint/topgit.git
18 2. cd topgit
19 3. tg remote --populate origin
20
21 TODO: debcheckout support
22
23 Branches in use
24 '''''''''''''''
25 The following branches are in use in the package:
26
27 - upstream: tracks the upstream Git repository
28 - fixes/*: patches fixing problems with upstream
29 - features/*: patches providing new features, targetted upstream
30 - master: the main Debianisation branch
31 - debian/*: Debian-specific patches
32
33 upstream and master are regular Git branches, while the others are TopGit
34 branches. The reason why master is not a TopGit branch itself is so that it's
35 possible to export all TopGit-managed branches into the quilt series, without
36 having to make an exception for master.
37
38 2. Developing a new feature
39 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
40 If you want to develop a new feature (or bug fix), first consider whether the
41 patch is intended to go upstream or is a Debian-specific change. Choose the
42 namespace accordingly and base it off upstream or master respectively. If the
43 patch depends on another patch, obviously base it off the respective TopGit
44 branch.
45
46 The following are the steps required to add a feature branch/patch:
47
48 1. tg create features/new-feature upstream
49    - or -
50    tg create debian/new-debian-stuff master
51
52 2. edit .topmsg and make the subject line be a short description, optionally
53    add a longer description to the body
54
55 3. git add .topmsg && git commit -m'create branch features/new-feature'
56
57 3. Obtaining the upstream tarball
58 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59 The upstream tarball for $VERSION can be obtained using pristine-tar:
60
61   pristine-tar checkout ../topgit_$VERSION.orig.tar.gz
62
63 4. Building the package
64 ~~~~~~~~~~~~~~~~~~~~~~~
65 To build the package, you are encouraged to include the TopGit make snippet at
66 the top of debian/rules:
67
68   -include /usr/share/topgit/topgit.mk
69
70 This will provide the tg-export target, which will create a quilt series of
71 all TopGit branches in the current repository.
72
73 You can also set the variable TG_BRANCHES to a space- or comma-separated list
74 (but not comma and space) of feature branches to export, e.g.:
75
76   TG_BRANCH := branch1,branch2
77   TG_BRANCH := 'branch3 branch4 branch 5'
78
79 (The TopGit package actually uses the local version of the file)
80
81 When you are ready to build, you check out the build branch, recreate
82 debian/patches, commit, build, test, upload, tag:
83
84 1. git checkout build
85 2. git merge master
86 3. ./debian/rules tg-export
87 4. git add debian/patches
88 5. git commit -m'preparing 0.5-1'
89 6. build, test, upload, tag ('debian/topgit-0.5-1')
90
91 5. Importing a new upstream version
92 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93 To import a new upstream, update the remote, merge the tag you want to merge
94 into the master branch, ideally together with an update to debian/changelog,
95 then update all TopGit branches:
96
97 1. git remote update
98 2. git checkout master
99 3. git merge topgit-0.5
100
101 Now proceed as in the next step.
102
103 6. Making changes to the master branch
104 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105 If you make changes to the master branch (the "debianisation" branch), follow
106 this procedure:
107
108 1. tg summary
109 2. for every branch that is prefixed with 'D' in the output:
110      git checkout $BRANCH && tg update
111
112 7. Building an upstream tarball
113 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
114 Until upstream provides official tarballs, the following can be used to create
115 them for Debian:
116
117 1. git checkout topgit-0.5
118 2. git archive --prefix=$(git describe HEAD)/ --verbose HEAD \
119     | gzip -9 > ../$(git describe HEAD | sed s,-,_,).orig.tar.gz
120 3. pristine-tar commit ../$(git describe HEAD | sed s,-,_,).orig.tar.gz \
121     HEAD
122 4. git checkout master
123
124 All comments and suggestions are welcome, especially those pertaining to
125 auto-generating debian/changelog from commit logs.
126
127  -- martin f. krafft <madduck@debian.org>  Mon, 11 Aug 2008 17:32:48 -0300