chiark / gitweb /
fix quilt fixup
[dgit.git] / dgit.1
1 .TH dgit 1 "" "Debian Project" "dgit"
2 .SH NAME
3 dgit \- git integration with the Debian archive
4 .
5 .SH SYNOPSIS
6 .B dgit
7 [\fIdgit\-opts\fP] \fBclone\fP [\fIdgit\-opts\fP]
8 \fIpackage\fP [\fIsuite\fP] [\fB./\fP\fIdir|\fB/\fP\fIdir]
9 .br
10 .B dgit
11 [\fIdgit\-opts\fP] \fBfetch\fP|\fBpull\fP [\fIdgit\-opts\fP]
12 [\fIsuite\fP]
13 .br
14 .B dgit
15 [\fIdgit\-opts\fP] \fBbuild\fP
16 [\fIgit\-buildpackage\-opts\fP|\fIdpkg\-buildpackage\-opts\fp]
17 .br
18 .B dgit
19 [\fIdgit\-opts\fP] \fBpush\fP [\fIdgit\-opts\fP]
20 [\fIsuite\fP]
21 .SH DESCRIPTION
22 .B dgit
23 treats the Debian archive as a version control system, and
24 bidirectionally gateways between the archive and git.  The git view of
25 the package can contain the usual upstream git history, and will be
26 augmented by commits representing uploads done by other developers not
27 using dgit.  This git history is stored in a canonical location known
28 as
29 .B dgit-repos
30 which lives outside the Debian archive (currently, on Alioth).
31
32 .B dgit clone
33 and
34 .B dgit fetch
35 consult the archive and dgit-repos and fetch and/or construct the
36 git view of the history.  With clone, the destination directory (by
37 default, the package name in the current directory) will be created,
38 and the new directory's `origin' remote will be set up to point to
39 the package's dgit-repos tree.
40
41 .B dgit build
42 runs
43 .B git-buildpackage
44 with some suitable options.  Options after
45 .B build
46 will be passed on to git-buildpackage.  It is not necessary to
47 use dgit build; it is OK to use any approach which ensures that
48 the generated source package corresponds to the relevant git commit.
49 Tagging and signing should be left to dgit push.
50
51 .B dgit push
52 does an `upload', pushing the current HEAD to the archive (as a source
53 package) and to dgit-repos (as git commits).  This also involves
54 making a signed git tag, and signing the files to be uploaded to the
55 archive.  (For a format `3.0 (quilt)' source package, dgit push
56 may also have to make a commit on your current branch to contain
57 quilt metadata.  It will do this automatically.)
58 .BR "debian/rules clean" .
59 .SH WORKFLOW - SIMPLE
60 It is always possible with dgit to clone or fetch a package, make
61 changes in git (using git-commit) on the suite branch
62 .RB ( "git checkout dgit/" \fIsuite\fR)
63 and then dgit push.  You can use whatever gitish techniques you like
64 to construct the commit to push; the only requirement is that it is a
65 descendant of the state of the archive, as provided by dgit in the
66 remote tracking branch
67 .BR remotes/dgit/ \fIsuite\fR.
68
69 If you are lucky the other uploaders have also used dgit and
70 integrated the other relevant git history; if not you can fetch it
71 into your tree and cherry-pick etc. as you wish.
72 .SH WORKFLOW - INTEGRATING BETWEEN DGIT AND OTHER GIT HISTORY
73 If you are the maintainer of a package dealing with uploads made
74 without dgit, you will probably want to merge the synthetic commits
75 (made by dgit to represent the uploads) into your git history.
76 Normally you can just merge the dgit branch into your own master, or
77 indeed if you do your work on the dgit local suite branch
78 .BI dgit/ suite
79 you can just use dgit pull.
80
81 However the first time dgit is used it will generate a new origin
82 commit from the archive which won't be linked into the rest of your
83 git history.  You will need to merge this.
84
85 If last upload was in fact made with git, you should usually proceed
86 as follows: identify the commit which was actually used to build the
87 package.  (Hopefully you have a tag for this.)  Check out the dgit
88 branch
89 .RB ( "git checkout dgit/" \fIsuite\fR)
90 and merge that other commit
91 .RB ( "git merge debian/" \fIversion\fR).
92 Hopefully this merge will be trivial because the two trees should
93 be the same.  The resulting branch head can be merged into your
94 working branches
95 .RB ( "git checkout master && git merge dgit/" \fIsuite\fR).
96
97 If last upload was not made with git, a different approach is required
98 to start using dgit.  First, do
99 .B dgit fetch
100 (or clone) obtain a git history representation of what's in the
101 archive and record it in the
102 .BI remotes/dgit/ suite
103 tracking branch.  Then construct somehow, using your other git history
104 plus appropriate diffs and cherry picks from the dgit remote tracking
105 branch, a git commit whose tree corresponds to the tree to use for the
106 next upload.  If that commit-to-be-uploaded is not a descendant of the
107 dig remote tracking branch, check it out and say
108 .BR "git merge -s ours remotes/dgit/" \fIsuite\fR;
109 that tells git that we are deliberately throwing away any differences
110 between what's in the archive and what you intend to upload.
111 Then run
112 .BR "dgit push"
113 to actually upload the result.
114 .SH MODEL
115 You may use any suitable git workflow with dgit, provided you
116 satisfy dgit's requirements:
117
118 dgit maintains a pseudo-remote called
119 .BR dgit ,
120 with one branch per suite.  This remote cannot be used with
121 plain git.
122
123 The
124 .B dgit-repos
125 repository for each package contains one ref per suite named
126 \fBrefs/dgit/\fR\fIsuite\fR.  These should be pushed to only by
127 dgit.  They are fast forwarding.  Each push on this branch
128 corresponds to an upload (or attempted upload).
129
130 However, it is perfectly fine to have other branches in dgit-repos;
131 normally the dgit-repos repo for the package will be accessible via
132 the remote name `origin'.
133
134 dgit push can operate on any commit which is a descendant of the
135 current dgit/suite tip in dgit-repos.
136
137 Uploads made by dgit contain an additional field
138 .B Vcs-Dgit-Master
139 in the source package .dsc.  (This is added by dgit push.)
140 This specifies a commit (an ancestor of the dgit/suite
141 branch) whose tree is identical to the unpacked source upload.
142
143 Uploads not made by dgit are represented in git by commits which are
144 synthesised by dgit.  The tree of each such commit corresponds to the
145 unpacked source; there is an origin commit with the contents, and a
146 psuedo-merge from last known upload - that is, from the contents of
147 the dgit/suite branch.
148
149 dgit expects repos that it works with to have a
150 .B dgit
151 remote.  This refers to the well-known dgit-repos location
152 (currently, the dgit-repos project on Alioth).  dgit fetch updates
153 the remote tracking branch for dgit/suite.
154
155 dgit does not (currently) represent the orig tarball(s) in git; nor
156 does it represent the patch statck of a `3.0 (quilt)' package.  The
157 orig tarballs are downloaded and kept in the parent directory, as with
158 a traditional (non-gitish) dpkg-source workflow.
159
160 To a user looking at the archive, changes pushed using dgit look like
161 changes made in an NMU: in a `3.0 (quilt)' package the delta from the
162 previous upload is recorded in a new patch constructed by dpkg-source.
163 .SH PACKAGE SOURCE FORMATS
164 If you are not the maintainer, you do not need to worry about the
165 source format of the package.  You can just make changes as you like
166 in git.  If the package is a `3.0 (quilt)' package, the patch stack
167 will usually not be represented in the git history.
168
169 If you are the maintainer of a non-native package, you currently have
170 two sensible options:
171
172 Firstly, you can regard your git history as primary, and the archive
173 as an export format.  For example, you could maintain topic branches
174 in git and a fast-forwarding release branch; or you could do your work
175 directly in a merging way on the
176 .BI dgit/ suite
177 branches.  If you do this you should probably use a `1.0' format
178 source package.  In the archive, the delta between upstream will be
179 represented in the single Debian patch.
180
181 Secondly, you can regard your quiltish patch stack in the archive as
182 primary.  You will have to use other tools besides dgit to import and
183 export this patch stack.  See also the BUGS section.
184 .SH OPTIONS
185 .TP
186 .BR --dry-run | -n
187 Go through the motions, fetching all information needed, but do not
188 actually update the output(s).  For push, dgit does
189 the required checks and leaves the new .dsc in a temporary file,
190 but does not sign, tag, push or upload.
191 .TP
192 .BI -k keyid
193 Use
194 .I keyid
195 for signing the tag and the upload.
196 .TP
197 .BR --no-sign
198 does not sign tags or uploads (meaningful only with push).
199 .TP
200 .TP
201 .BI -p package
202 Specifies that we should process source package
203 .I package
204 rather than looking in debian/control or debian/changelog.
205 Valid with dgit fetch and dgit pull, only.
206 .TP
207 .BR -N | --new
208 The package may be new in this suite.  Without this, dgit will
209 refuse to push.
210 .TP
211 .BI -D
212 Prints debugging information to stderr.  Repeating the option produces
213 more output (currently, up to -DD is meaningfully different).
214 .TP
215 .BI -c name = value
216 Specifies a git configuration option.  dgit itself is also controlled
217 by git configuration options.
218 .TP
219 .RI \fB--dget=\fR program |\fB--dput=\fR program |\fB--debsign=\fR program
220 Specifies alternative programs to use instead of dget, dput
221 or debsign.
222 .TP
223 .RI \fB--dget:\fR option |\fB--dput:\fR option |\fB--debsign:\fR option
224 Specifies a single additional option to pass to dget, dput or
225 debsign.  Use repeatedly if multiple additional options are required.
226 .TP
227 .BI -C changesfile
228 Specifies the .changes file which is to be uploaded.  By default
229 dgit push looks for single .changes file in the parent directory whose
230 filename suggests it is for the right package and version.
231 .TP
232 .BI --existing-package= package
233 dgit push needs to canonicalise the suite name.  But currently
234 there is no way to ask the archive to do this without knowing the
235 name of an existing package.  Without --new we can just use the
236 package we are trying to push.  But with --new that will not work, so
237 we guess that
238 .SH CONFIGURATION
239 dgit looks at the following git config keys to control its behaviour.
240 You may set them with git-config (either in system-global or per-tree
241 configuration), or provide
242 .BI -c key = value
243 on the dgit command line.
244 .TP
245 .BI dgit-suite. suite .distro
246 .TP
247 .BI dgit.default.distro
248 .TP
249 .BI dgit.default.username
250 .TP
251 .BI dgit-distro. distro .git-url
252 .TP
253 .BI dgit-distro. distro .git-host
254 .TP
255 .BI dgit-distro. distro .git-proto
256 .TP
257 .BI dgit-distro. distro .git-path
258 .TP
259 .BI dgit-distro. distro .git-check
260 .TP
261 .BI dgit-distro. distro .git-create
262 .TP
263 .BI dgit-distro. distro .upload-host
264 .TP
265 .BI dgit-distro. distro .mirror
266 .TP
267 .BI dgit-distro. distro .archive-query
268 .TP
269 .BI dgit-distro. distro .archive-query-default-component
270 .TP
271 .BI dgit-distro. distro .ssh
272 .TP
273 .BR dgit.default. *
274 for each
275 .BR dgit-distro. \fIdistro\fR . *
276 .SH BUGS
277 We should be using some kind of vhost/vpath setup for the git repos on
278 alioth, so that they can be moved later if and when this turns out to
279 be a good idea.
280
281 Debian Policy needs to be updated to describe the new Vcs-Dgit-Master
282 field (and to specify that it is an RC bug for that field to refer
283 to an unavailable commit).
284
285 The method of canonicalising suite names is bizarre.  See the
286 .B --existing-package
287 option for one of the implication.s
288
289 dgit push should perhaps do `git push origin', or something similar,
290 by default.
291
292 The mechanism for checking for and creating per-package repos on
293 alioth is a hideous bodge.  One consequence is that dgit currently
294 only works for people with push access.
295
296 Debian Maintainers are currently not able to push, as there is not
297 currently any mechanism for determining and honouring the archive's
298 ideas about access control.  Currently only DDs can push.
299
300 dgit's representation of format `3.0 (quilt)' source packages does not
301 represent the patch stack.  Currently the patch series representation
302 cannot round trip through the archive.  Ideally dgit would represent a
303 quilty package with an origin commit of some kind followed by the
304 patch stack as a series of commits followed by a pseudo-merge (to make
305 the branch fast-forwarding).  This would also mean a new `dgit
306 rebase-prep' command or some such to turn such a fast-forwarding
307 branch back into a rebasing patch stack, and a `force' option to dgit
308 push (perhaps enabled automatically by a note left by rebase-prep)
309 which will make the required pseudo-merge.
310
311 If the dgit push fails halfway through, it should be restartable and
312 idempotent.  However this is not true for the git tag operation.
313 Also, it would be good to check that the proposed signing key is
314 available before starting work.
315
316 dgit's handling of .orig.tar.gz is not very sophisticated.  Ideally
317 the .orig.tar.gz could be transported via the git repo as git tags.
318 Doing this is made more complicated by the possibility of a `3.0
319 (quilt)' package with multiple .orig tarballs.
320
321 The error messages are often unhelpfully terse and tend to refer to
322 line numbers in dgit.
323
324 The option parser requires values to be cuddled to the option name.
325
326 dgit assumes knowledge of the archive layout.  There appears to be no
327 sane way to find the path in the archive pool of the .dsc for a
328 particular suite.  I'm assured that the archive layout is a
329 `well known algorithm' by now.
330
331 --dry-run often does not work with fetch, even though this is a
332 logically plausible request.  (It fails, instead.)