1 Building topgit for Debian
2 --------------------------
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.
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.3) installed before
13 1. Cloning the repository
14 ~~~~~~~~~~~~~~~~~~~~~~~~~
15 Cloning a TopGit repository requires an additional step to normal Git cloning:
17 1. git clone ssh://git.debian.org/git/collab-maint/topgit.git
19 3. tg remote --populate origin
21 TODO: debcheckout support
25 The following branches are in use in the package:
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
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.
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
46 The following are the steps required to add a feature branch/patch:
48 1. tg create features/new-feature upstream
50 tg create debian/new-debian-stuff master
52 2. edit .topmsg and make the subject line be a short description, optionally
53 add a longer description to the body
55 3. git add .topmsg && git commit -m'create branch features/new-feature'
57 3. Obtaining the upstream tarball
58 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59 The upstream tarball for $VERSION can be obtained using pristine-tar:
61 pristine-tar checkout ../topgit_$VERSION.orig.tar.gz
63 4. Building the package
64 ~~~~~~~~~~~~~~~~~~~~~~~
65 To build the package, you check out the build branch, recreate debian/patches,
66 commit, build, test, upload, tag:
68 1. tg create stage-0.4-1 debian/locations
69 2. git commit -m'staging 0.4-1'
70 3. tg export --quilt debian/patches.new
71 4. rm debian/patches.new/stage-*
72 5. sed -i '/^stage-/d' debian/patches.new/series
73 6. git checkout build && git rm -r debian/patches
74 7. mv debian/patches.new debian/patches && git add debian/patches
75 8. git commit -m'preparing 0.4-1'
76 9. build, test, upload, tag ('debian/topgit-0.4-1')
77 10. tg delete stage-0.4-1
79 This process is still very cumbersome and needs to be improved, ideally within
82 TODO: provide Makefile snippet for the above to prevent useless duplication (#501991)
83 TODO: rewrite to use tg-export -b, which will be fixed in TopGit 0.5 (#500273)
85 5. Importing a new upstream version
86 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
87 To import a new upstream, update the remote, merge the tag you want to merge
88 into the master branch, ideally together with an update to debian/changelog,
89 then update all TopGit branches:
92 2. git checkout master
93 3. git merge topgit-0.4
95 Now proceed as in the next step.
97 6. Making changes to the master branch
98 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
99 If you make changes to the master branch (the "debianisation" branch), follow
103 2. for every branch that is prefixed with 'D' in the output:
104 git checkout $BRANCH && tg update
105 3. git checkout build && git merge master
107 7. Building an upstream tarball
108 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
109 Until upstream provides official tarballs, the following can be used to create
112 1. git checkout topgit-0.4
113 2. git archive --prefix=$(git describe HEAD)/ --verbose HEAD \
114 | gzip -9 > ../$(git describe HEAD | sed s,-,_,).orig.tar.gz
115 3. pristine-tar commit ../$(git describe HEAD | sed s,-,_,).orig.tar.gz \
117 4. git checkout master
119 All comments and suggestions are welcome, especially those pertaining to
120 auto-generating debian/changelog from commit logs.
122 -- martin f. krafft <madduck@debian.org> Mon, 11 Aug 2008 17:32:48 -0300