chiark / gitweb /
Autogenerated quilt patch fixup patch Description contains several recent git commits...
[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\fR]
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|\fBsbuild\fP|\fBbuild-source\fP
16 [\fIbuild\-opts\fp]
17 .br
18 .B dgit
19 [\fIdgit\-opts\fP] \fBpush\fP [\fIdgit\-opts\fP]
20 [\fIsuite\fP]
21 .br
22 .B dgit
23 [\fIdgit\-opts\fP] \fIaction\fR ...
24 .SH DESCRIPTION
25 .B dgit
26 treats the Debian archive as a version control system, and
27 bidirectionally gateways between the archive and git.  The git view of
28 the package can contain the usual upstream git history, and will be
29 augmented by commits representing uploads done by other developers not
30 using dgit.  This git history is stored in a canonical location known
31 as
32 .B dgit-repos
33 which lives outside the Debian archive (currently, on Alioth).
34
35 The usual workflow is: 1. clone or fetch; 2. make and commit changes
36 in git as desired; 3. run dgit build, dgit sbuild or dgit
37 build-source, or generate the source and binary packages for upload
38 some other way; 4. do pre-upload tests of the proposed upload; 5. run
39 dgit push.
40 .TP
41 \fBdgit clone\fR \fIpackage\fP [\fIsuite\fP] [\fB./\fP\fIdir|\fB/\fP\fIdir\fR]
42 Consults the archive and dgit-repos to construct the git view of
43 history for
44 .I package
45 in
46 .I suite
47 .RB ( sid
48 by default)
49 in a new directory (named
50 .BI ./ package
51 by default);
52 also, downloads any necessary orig tarballs.
53
54 The suite's git tip is
55 left on the local branch
56 .BI dgit/ suite
57 ready for work, and on the corresponding dgit remote tracking branch.
58 Also, the
59 .B origin
60 remote will be set up to point to the package's dgit-repos tree
61 for the distro to which
62 .I suite
63 belongs.
64 .TP
65 \fBdgit fetch\fR [\fIsuite\fP]
66 Consults the archive and git-repos to update the git view of
67 history for a specific suite (and downloads any necessary orig
68 tarballs), and updates the remote tracking branch
69 .BR remotes/dgit/dgit/ \fIsuite\fR.
70 If the current branch is
71 .BI dgit/ suite
72 then dgit fetch defaults to
73 .IR suite ;
74 otherwise it parses debian/changelog and uses the suite specified
75 there.
76 .TP
77 \fBdgit pull\fR [\fIsuite\fP]
78 Does dgit fetch, and then merges the new head of the remote tracking
79 branch
80 .BI remotes/dgit/dgit/ suite
81 into the current branch.
82 .TP
83 \fBdgit build\fR ...
84 Runs
85 .B git-buildpackage
86 with some suitable options.  Options and argumments after build
87 will be passed on to git-buildpackage.  It is not necessary to use
88 dgit build when using dgit; it is OK to use any approach which ensures
89 that the generated source package corresponds to the relevant git
90 commit.
91
92 .B NB
93 that this function will be changed in the future to use
94 dpkg-buildpackage directly.
95
96 Tagging, signing and actually uploading should be left to dgit push.
97 .TP
98 \fBdgit build-source\fR ...
99 Builds the source package, and a changes file for a prospective
100 source-only upload.  The output is left in
101 .IR package \fB_\fR version \fB.dsc\fR
102 and
103 .IR package \fB_\fR version \fB_source.changes\fR.
104
105 Tagging, signing and actually uploading should be left to dgit push.
106 .TP
107 \fBdgit sbuild\fR ...
108 Constructs the source package, and uses sbuild to do a binary
109 build, and uses mergechanges to merge the source and binary
110 changes files.  Options and argumments after sbuild will be passed on
111 to sbuild.  Changes files matching
112 .IB package _ version _*.changes
113 in the parent directory will be removed; the output is left in
114 .IR package \fB_\fR version \fB_multi.changes\fR.
115
116 Tagging, signing and actually uploading should be left to dgit push.
117 .TP
118 .B dgit push
119 Does an `upload', pushing the current HEAD to the archive (as a source
120 package) and to dgit-repos (as git commits).  The package must already
121 have been built ready for upload, with the .dsc and .changes
122 left in the parent directory.
123
124 In more detail: dgit push checks that the current HEAD corresponds to
125 the .dsc.  It then pushes the HEAD to the suite's dgit-repos branch,
126 makes a signed git tag, edits the .dsc to contain the dgit metadata
127 field, runs debsign to sign the upload (.dsc and .changes), pushes the
128 signed tag, and finally uses dput to upload the .changes to the
129 archive.
130
131 dgit push always uses the package, suite and version specified in the
132 debian/changelog and the .dsc, which must agree.
133
134 If dgit push fails while uploading, it is fine to simply retry the
135 dput on the .changes file at your leisure.
136 .TP
137 .B dgit quilt-fixup
138 Looks to see if the tree is one which dpkg-source cannot properly
139 represent.  If it isn't, dgit will fix it up for you (in quilt terms,
140 by making a new debian/ patch containing your unquilty changes) and
141 make a commit of the changes it has made.
142
143 This is normally done automatically by dgit build and dgit push.
144 .SH WORKFLOW - SIMPLE
145 It is always possible with dgit to clone or fetch a package, make
146 changes in git (using git-commit) on the suite branch
147 .RB ( "git checkout dgit/" \fIsuite\fR)
148 and then dgit push.  You can use whatever gitish techniques you like
149 to construct the commit to push; the only requirement is that it is a
150 descendant of the state of the archive, as provided by dgit in the
151 remote tracking branch
152 .BR remotes/dgit/dgit/ \fIsuite\fR.
153
154 If you are lucky the other uploaders have also used dgit and
155 integrated the other relevant git history; if not you can fetch it
156 into your tree and cherry-pick etc. as you wish.
157 .SH WORKFLOW - INTEGRATING BETWEEN DGIT AND OTHER GIT HISTORY
158 If you are the maintainer of a package dealing with uploads made
159 without dgit, you will probably want to merge the synthetic commits
160 (made by dgit to represent the uploads) into your git history.
161 Normally you can just merge the dgit branch into your own master, or
162 indeed if you do your work on the dgit local suite branch
163 .BI dgit/ suite
164 you can just use dgit pull.
165
166 However the first time dgit is used it will generate a new origin
167 commit from the archive which won't be linked into the rest of your
168 git history.  You will need to merge this.
169
170 If last upload was in fact made with git, you should usually proceed
171 as follows: identify the commit which was actually used to build the
172 package.  (Hopefully you have a tag for this.)  Check out the dgit
173 branch
174 .RB ( "git checkout dgit/" \fIsuite\fR)
175 and merge that other commit
176 .RB ( "git merge debian/" \fIversion\fR).
177 Hopefully this merge will be trivial because the two trees should
178 be the same.  The resulting branch head can be merged into your
179 working branches
180 .RB ( "git checkout master && git merge dgit/" \fIsuite\fR).
181
182 If last upload was not made with git, a different approach is required
183 to start using dgit.  First, do
184 .B dgit fetch
185 (or clone) to obtain a git history representation of what's in the
186 archive and record it in the
187 .BI remotes/dgit/dgit/ suite
188 tracking branch.  Then somehow, using your other git history
189 plus appropriate diffs and cherry picks from the dgit remote tracking
190 branch, construct a git commit whose tree corresponds to the tree to use for the
191 next upload.  If that commit-to-be-uploaded is not a descendant of the
192 dig remote tracking branch, check it out and say
193 .BR "git merge -s ours remotes/dgit/dgit/" \fIsuite\fR;
194 that tells git that we are deliberately throwing away any differences
195 between what's in the archive and what you intend to upload.
196 Then run
197 .BR "dgit push"
198 to actually upload the result.
199 .SH MODEL
200 You may use any suitable git workflow with dgit, provided you
201 satisfy dgit's requirements:
202
203 dgit maintains a pseudo-remote called
204 .BR dgit ,
205 with one branch per suite.  This remote cannot be used with
206 plain git.
207
208 The
209 .B dgit-repos
210 repository for each package contains one ref per suite named
211 \fBrefs/dgit/\fR\fIsuite\fR.  These should be pushed to only by
212 dgit.  They are fast forwarding.  Each push on this branch
213 corresponds to an upload (or attempted upload).
214
215 However, it is perfectly fine to have other branches in dgit-repos;
216 normally the dgit-repos repo for the package will be accessible via
217 the remote name `origin'.
218
219 dgit push will also (by default) make signed tags called
220 .BI debian/ version
221 and push them to dgit-repos, but nothing depends on these tags
222 existing.
223
224 dgit push can operate on any commit which is a descendant of the
225 current dgit/suite tip in dgit-repos.
226
227 Uploads made by dgit contain an additional field
228 .B Vcs-Dgit-Master
229 in the source package .dsc.  (This is added by dgit push.)
230 This specifies a commit (an ancestor of the dgit/suite
231 branch) whose tree is identical to the unpacked source upload.
232
233 Uploads not made by dgit are represented in git by commits which are
234 synthesised by dgit.  The tree of each such commit corresponds to the
235 unpacked source; there is an origin commit with the contents, and a
236 psuedo-merge from last known upload - that is, from the contents of
237 the dgit/suite branch.
238
239 dgit expects repos that it works with to have a
240 .B dgit
241 remote.  This refers to the well-known dgit-repos location
242 (currently, the dgit-repos project on Alioth).  dgit fetch updates
243 the remote tracking branch for dgit/suite.
244
245 dgit does not (currently) represent the orig tarball(s) in git; nor
246 does it represent the patch statck of a `3.0 (quilt)' package.  The
247 orig tarballs are downloaded and kept in the parent directory, as with
248 a traditional (non-gitish) dpkg-source workflow.
249
250 To a user looking at the archive, changes pushed using dgit look like
251 changes made in an NMU: in a `3.0 (quilt)' package the delta from the
252 previous upload is recorded in a new patch constructed by dpkg-source.
253 .SH PACKAGE SOURCE FORMATS
254 If you are not the maintainer, you do not need to worry about the
255 source format of the package.  You can just make changes as you like
256 in git.  If the package is a `3.0 (quilt)' package, the patch stack
257 will usually not be represented in the git history.
258
259 If you are the maintainer of a non-native package, you currently have
260 two sensible options:
261
262 Firstly, you can regard your git history as primary, and the archive
263 as an export format.  For example, you could maintain topic branches
264 in git and a fast-forwarding release branch; or you could do your work
265 directly in a merging way on the
266 .BI dgit/ suite
267 branches.  If you do this you should probably use a `1.0' format
268 source package if you can.  In the archive, the delta between upstream
269 will be represented in the single Debian patch.
270
271 Secondly, you can use `3.0 (quilt)', and regard your quiltish patch
272 stack in the archive as primary.  You will have to use other tools
273 besides dgit to import and export this patch stack.  But see below:
274 .SH FORMAT 3.0 (QUILT)
275 For a format `3.0 (quilt)' source package, dgit may have to make a
276 commit on your current branch to contain metadata used by quilt and
277 dpkg-source.
278
279 This is because (i) the `3.0 (quilt)' source format cannot represent
280 certain trees, and (ii) packing up a tree in `3.0 (quilt)' and then
281 unpacking it does not always yield the same tree.  Instead,
282 dpkg-source insists on the trees having extra quilty metadata and
283 patch files in the debian/ and .pc/ directories, which dpkg-source
284 sometimes modifies.
285
286 dgit will automatically work around this braindamage for you when
287 building and pushing.  The only thing you need to know is that dgit
288 build, sbuild, etc., may make a new commit on your HEAD.  If you're
289 not a quilt user this commit won't contain any changes to files you
290 care about.
291
292 You can explicitly request that dgit do just this fixup, by running
293 dgit quilt-fixup.
294
295 We recommend against the use of `3.0 (quilt)'.
296 .SH OPTIONS
297 .TP
298 .BR --dry-run | -n
299 Go through the motions, fetching all information needed, but do not
300 actually update the output(s).  For push, dgit does
301 the required checks and leaves the new .dsc in a temporary file,
302 but does not sign, tag, push or upload.
303 .TP
304 .BI -k keyid
305 Use
306 .I keyid
307 for signing the tag and the upload.
308 .TP
309 .BR --no-sign
310 does not sign tags or uploads (meaningful only with push).
311 .TP
312 .TP
313 .BI -p package
314 Specifies that we should process source package
315 .I package
316 rather than looking in debian/control or debian/changelog.
317 Valid with dgit fetch and dgit pull, only.
318 .TP
319 .BR --clean=git | -wg
320 The source tree should be cleaned, before building a source package
321 with one of the build options, using
322 .BR "git clean -xdf" .
323 This will delete all files which are not tracked by git.
324 .TP
325 .BR --clean=none | -wn
326 Do not clean the tree before building a source package.  If there are
327 files which are not in git, a subsequent dgit push will fail.
328 .TP
329 .BR --clean=dpkg-source | -wd
330 Use dpkg-buildpackage to do the build, so that the source package
331 is cleaned by dpkg-source running the package's clean target.
332 This is the default.  It requires the package's build dependencies.
333 .TP
334 .BR -N | --new
335 The package may be new in this suite.  Without this, dgit will
336 refuse to push.
337 .TP
338 .BI -D
339 Prints debugging information to stderr.  Repeating the option produces
340 more output (currently, up to -DD is meaningfully different).
341 .TP
342 .BI -c name = value
343 Specifies a git configuration option.  dgit itself is also controlled
344 by git configuration options.
345 .TP
346 .RI \fB-v\fR version |\fB-m\fR maintaineraddress
347 Passed to dpkg-genchanges (eventually).
348 .TP
349 .RI \fB--ch:\fR option
350 Specifies a single additional option to pass, eventually, to
351 dpkg-genchanges.
352 .TP
353 .RI \fB--dget=\fR program |\fB--dput=\fR program |...
354 Specifies alternative programs to use instead of
355 .BR dget ,
356 .BR dput ,
357 .BR debsign ,
358 .BR dpkg-source ,
359 .BR dpkg-buildpackage ,
360 .BR dpkg-genchanges ,
361 .BR sbuild ,
362 or
363 .BR mergechanges .
364 This applies only when the program is invoked directly by dgit.
365 .TP
366 .RI \fB--dget:\fR option |\fB--dput:\fR option |...
367 Specifies a single additional option to pass to
368 .BR dget ,
369 .BR dput ,
370 .BR debsign ,
371 .BR dpkg-source ,
372 .BR dpkg-buildpackage ,
373 .BR dpkg-genchanges ,
374 .BR sbuild ,
375 or
376 .BR mergechanges .
377 Can be repeated as necessary.
378 This applies only when the program is invoked directly by dgit.
379 Usually, for passing options to dpkg-genchanges, use
380 .BR --ch: \fIoption\fR.
381 .TP
382 .BR -d "\fIdistro\fR | " --distro= \fIdistro\fR
383 Specifies that the suite to be operated on is part of distro
384 .IR distro .
385 This overrides the default value found from the git config option
386 .BR dgit-suite. \fIsuite\fR .distro .
387 The only effect is that other configuration variables (used
388 for accessing the archive and dgit-repos) used are
389 .BR dgit-distro. \fIdistro\fR .* .
390
391 If your suite is part of a distro that dgit already knows about, you
392 can use this option to make dgit work even if your dgit doesn't know
393 about the suite.  For example, specifying
394 .B -ddebian
395 will work when the suite is an unknown suite in the Debian archive.
396
397 To define a new distro it is necessary to define methods and URLs
398 for fetching (and, for dgit push, altering) a variety of information both
399 in the archive and in dgit-repos.  How to do this is not yet
400 documented, and currently the arrangements are unpleasant.  See
401 BUGS.
402 .TP
403 .BI -C changesfile
404 Specifies the .changes file which is to be uploaded.  By default
405 dgit push looks for single .changes file in the parent directory whose
406 filename suggests it is for the right package and version - or,
407 if there is a _multi.changes file, dgit uses that.
408 .TP
409 .BI --existing-package= package
410 dgit push needs to canonicalise the suite name.  But currently
411 there is no way to ask the archive to do this without knowing the
412 name of an existing package.  Without --new we can just use the
413 package we are trying to push.  But with --new that will not work, so
414 we guess
415 .B dpkg
416 or use the value of this option.
417 .TP
418 .BR -h | --help
419 Print a usage summary.
420 .SH SEE ALSO
421 \fBdget\fP(1),
422 \fBdput\fP(1),
423 \fBdebsign\fP(1),
424 \fBgit-config\fP(1),
425 \fBgit-buildpackage\fP(1),
426 \fBdpkg-buildpackage\fP(1),
427 .br
428 https://wiki.debian.org/Alioth
429 .SH CONFIGURATION
430 dgit looks at the following git config keys to control its behaviour.
431 You may set them with git-config (either in system-global or per-tree
432 configuration), or provide
433 .BI -c key = value
434 on the dgit command line.
435 .TP
436 .BI dgit-suite. suite .distro
437 .TP
438 .BI dgit.default.distro
439 .TP
440 .BI dgit-distro. distro .username
441 .TP
442 .BI dgit-distro. distro .git-url
443 .TP
444 .BI dgit-distro. distro .git-user
445 .TP
446 .BI dgit-distro. distro .git-host
447 .TP
448 .BI dgit-distro. distro .git-proto
449 .TP
450 .BI dgit-distro. distro .git-path
451 .TP
452 .BI dgit-distro. distro .git-check
453 .TP
454 .BI dgit-distro. distro .git-create
455 .TP
456 .BI dgit-distro. distro .upload-host
457 .TP
458 .BI dgit-distro. distro .mirror
459 .TP
460 .BI dgit-distro. distro .archive-query
461 .TP
462 .BI dgit-distro. distro .archive-query-default-component
463 .TP
464 .BI dgit-distro. distro .sshdakls-user
465 .TP
466 .BI dgit-distro. distro .sshdakls-host
467 .TP
468 .BI dgit-distro. distro .sshdakls-dir
469 .TP
470 .BI dgit-distro. distro .ssh
471 .TP
472 .BI dgit-distro. distro .keyid
473 .TP
474 .BR dgit.default. *
475 for each
476 .BR dgit-distro. \fIdistro\fR . *
477 .SH BUGS
478 We should be using some kind of vhost/vpath setup for the git repos on
479 alioth, so that they can be moved later if and when this turns out to
480 be a good idea.
481
482 Debian Policy needs to be updated to describe the new Vcs-Dgit-Master
483 field (and to specify that it is an RC bug for that field to refer
484 to an unavailable commit).
485
486 The method of canonicalising suite names is bizarre.  See the
487 .B --existing-package
488 option for one of the implications.
489
490 dgit push should perhaps do `git push origin', or something similar,
491 by default.
492
493 Debian does not have a working rmadison server, so to find out what
494 version of a package is in the archive, or to canonicalise suite
495 names, we ssh directly into the ftpmaster server.
496
497 The mechanism for checking for and creating per-package repos on
498 alioth is a hideous bodge.  One consequence is that dgit currently
499 only works for people with push access.
500
501 Debian Maintainers are currently not able to push, as there is not
502 currently any mechanism for determining and honouring the archive's
503 ideas about access control.  Currently only DDs can push.
504
505 dgit's representation of format `3.0 (quilt)' source packages does not
506 represent the patch stack.  Currently the patch series representation
507 cannot round trip through the archive.  Ideally dgit would represent a
508 quilty package with an origin commit of some kind followed by the
509 patch stack as a series of commits followed by a pseudo-merge (to make
510 the branch fast-forwarding).  This would also mean a new `dgit
511 rebase-prep' command or some such to turn such a fast-forwarding
512 branch back into a rebasing patch stack, and a `force' option to dgit
513 push (perhaps enabled automatically by a note left by rebase-prep)
514 which will make the required pseudo-merge.
515
516 If the dgit push fails halfway through, it should be restartable and
517 idempotent.  However this is not true for the git tag operation.
518 Also, it would be good to check that the proposed signing key is
519 available before starting work.
520
521 dgit's handling of .orig.tar.gz is not very sophisticated.  Ideally
522 the .orig.tar.gz could be transported via the git repo as git tags.
523 Doing this is made more complicated by the possibility of a `3.0
524 (quilt)' package with multiple .orig tarballs.
525
526 dgit's build functions, and dgit push, should not make any changes to
527 your current HEAD.  Sadly this is necessary for packages in the `3.0
528 (quilt)' source format.  This is ultimately due to design problems in
529 quilt and dpkg-source.
530
531 There should be an option which arranges for the `3.0 (quilt)'
532 autocommit to not appear on your HEAD, but instead only in the
533 remote tracking suite branch.
534
535 There should at the very least be some advice in the manpage about how
536 to use dgit when the signing key is not available on the same machine
537 as the build host.
538
539 The option parser requires values to be cuddled to the option name.
540
541 dgit assumes knowledge of the archive layout.  There appears to be no
542 sane way to find the path in the archive pool of the .dsc for a
543 particular suite.  I'm assured that the archive layout is a
544 `well known algorithm' by now.
545
546 --dry-run often does not work with fetch, even though this is a
547 logically plausible request.  (It fails, instead.)