chiark / gitweb /
dgit(1): Mention need for dgit sbuild -A
[dgit.git] / dgit.1
1 '\" t
2 .TH dgit 1 "" "Debian Project" "dgit"
3 .SH NAME
4 dgit \- git integration with the Debian archive
5 .
6 .SH SYNOPSIS
7 .B dgit
8 [\fIdgit\-opts\fP] \fBclone\fP [\fIdgit\-opts\fP]
9 \fIpackage\fP [\fIsuite\fP] [\fB./\fP\fIdir|\fB/\fP\fIdir\fR]
10 .br
11 .B dgit
12 [\fIdgit\-opts\fP] \fBfetch\fP|\fBpull\fP [\fIdgit\-opts\fP]
13 [\fIsuite\fP]
14 .br
15 .B dgit
16 [\fIdgit\-opts\fP] \fBbuild\fP|\fBsbuild\fP|\fBbuild-source\fP
17 [\fIbuild\-opts\fp]
18 .br
19 .B dgit
20 [\fIdgit\-opts\fP] \fBpush\fP [\fIdgit\-opts\fP]
21 [\fIsuite\fP]
22 .br
23 .B dgit
24 [\fIdgit\-opts\fP] \fBrpush\fR \fIbuild-host\fR\fB:\fR\fIbuild-dir\fR
25 [\fIpush args...\fR]
26 .br
27 .B dgit
28 [\fIdgit\-opts\fP] \fIaction\fR ...
29 .SH DESCRIPTION
30 .B dgit
31 allows you to treat the Debian archive as if it were a git
32 repository.
33
34 This is the command line reference.
35 Please read the tutorial(s):
36 .TS
37 lb l.
38 dgit-user(7)    for users: editing, building and sharing packages
39 dgit-nmu-simple(7)      for DDs: doing a straightforward NMU
40 dgit-maint-native(7)    for maintainers of Debian-native packages
41 dgit-maint-merge(7)     for maintainers who want a pure git workflow
42 dgit-maint-gbp(7)       for maintainers already using git-buildpackage
43 dgit-sponsorship(7)     for sponsors and sponsored contributors
44 .TE
45 .LP
46 See \fBdgit(7)\fP for detailed information about the data
47 model,
48 common problems likely to arise with certain kinds of package,
49 etc.
50 .SH OPERATIONS
51 .TP
52 \fBdgit clone\fR \fIpackage\fP [\fIsuite\fP] [\fB./\fP\fIdir|\fB/\fP\fIdir\fR]
53 Consults the archive and dgit-repos to construct the git view of
54 history for
55 .I package
56 in
57 .I suite
58 .RB ( sid
59 by default)
60 in a new directory (named
61 .BI ./ package
62 by default);
63 also, downloads any necessary orig tarballs.
64
65 The suite's git tip is
66 left on the local branch
67 .BI dgit/ suite
68 ready for work, and on the corresponding dgit remote tracking branch.
69 The
70 .B origin
71 remote will be set up to point to the package's dgit-repos tree
72 for the distro to which
73 .I suite
74 belongs.
75
76 .I suite
77 may be a combination of several underlying suites in the form
78 .IR mainsuite \fB,\fR subsuite ...;
79 see COMBINED SUITES in dgit(7).
80
81 For your convenience, the
82 .B vcs-git
83 remote will be set up from the package's Vcs-Git field, if there is
84 one - but note that in the general case the history found there may be
85 different to or even disjoint from dgit's view.
86 .TP
87 \fBdgit fetch\fR [\fIsuite\fP]
88 Consults the archive and git-repos to update the git view of
89 history for a specific suite (and downloads any necessary orig
90 tarballs), and updates the remote tracking branch
91 .BR remotes/dgit/dgit/ \fIsuite\fR.
92 If the current branch is
93 .BI dgit/ suite
94 then dgit fetch defaults to
95 .IR suite ;
96 otherwise it parses debian/changelog and uses the suite specified
97 there.
98 suite may be a combined suite, as for clone.
99 .TP
100 \fBdgit pull\fR [\fIsuite\fP]
101 Does dgit fetch, and then merges the new head of the remote tracking
102 branch
103 .BI remotes/dgit/dgit/ suite
104 into the current branch.
105 .TP
106 \fBdgit build\fR ...
107 Runs
108 .B dpkg-buildpackage
109 with some suitable options.  Options and arguments after build
110 will be passed on to dpkg-buildpackage.  It is not necessary to use
111 dgit build when using dgit; it is OK to use any approach which ensures
112 that the generated source package corresponds to the relevant git
113 commit.
114
115 Tagging, signing and actually uploading should be left to dgit push.
116 .TP
117 \fBdgit build-source\fR ...
118 Builds the source package, and a changes file for a prospective
119 source-only upload, using
120 .BR dpkg-source .
121 The output is left in
122 .IR package \fB_\fR version \fB.dsc\fR
123 and
124 .IR package \fB_\fR version \fB_source.changes\fR.
125
126 Tagging, signing and actually uploading should be left to dgit push.
127 .TP
128 .B dgit clean
129 Cleans the current working tree (according to the --clean= option in
130 force).
131 .TP
132 .B dgit help
133 Print a usage summary.
134 .TP
135 \fBdgit sbuild\fR ...
136 Constructs the source package, uses
137 .B  sbuild
138 to do a binary build, and uses mergechanges to merge the source and
139 binary changes files.  Options and arguments after sbuild will be
140 passed on to sbuild.
141 The output is left in
142 .IR package \fB_\fR version \fB_multi.changes\fR.
143 .IP
144 Note that by default
145 sbuild does not build arch-independent packages.
146 You probably want to pass -A, to request those.
147 .IP
148 Tagging, signing and actually uploading should be left to dgit push.
149 .TP
150 \fBdgit gbp-build\fR ...
151 Runs
152 .B git-buildpackage
153 with some suitable options.  Options and arguments after gbp-build
154 will be passed on to git-buildpackage.
155
156 By default this uses \-\-quilt=gbp, so HEAD should be a
157 git-buildpackage style branch, not a patches-applied branch.
158
159 Tagging, signing and actually uploading should be left to dgit push.
160 .TP
161 \fBdgit push\fR [\fIsuite\fP]
162 Does an `upload', pushing the current HEAD to the archive (as a source
163 package) and to dgit-repos (as git commits).  The package must already
164 have been built ready for upload, with the .dsc and .changes
165 left in the parent directory.  It is normally best to do the build
166 with dgit too (eg with dgit sbuild): some existing build tools pass
167 unhelpful options to dpkg-source et al by default, which can result in
168 the built source package not being identical to the git tree.
169
170 In more detail: dgit push checks that the current HEAD corresponds to
171 the .dsc.  It then pushes the HEAD to the suite's dgit-repos branch,
172 adjusts the .changes to include any .origs which the archive lacks
173 and exclude .origs which the archive has
174 (so -sa and -sd are not needed when building for dgit push),
175 makes a signed git tag, edits the .dsc to contain the dgit metadata
176 field, runs debsign to sign the upload (.dsc and .changes), pushes the
177 signed tag, and finally uses dput to upload the .changes to the
178 archive.
179
180 dgit push always uses the package, suite and version specified in the
181 debian/changelog and the .dsc, which must agree.  If the command line
182 specifies a suite then that must match too.
183
184 If dgit push fails while uploading, it is fine to simply retry the
185 dput on the .changes file at your leisure.
186 .TP
187 \fBdgit rpush\fR \fIbuild-host\fR\fB:\fR\fIbuild-dir\fR [\fIpush args...\fR]
188 Pushes the contents of the specified directory on a remote machine.
189 This is like running dgit push on build-host with build-dir as the
190 current directory; however, signing operations are done on the
191 invoking host.  This allows you to do a push when the system which has
192 the source code and the build outputs has no access to the key:
193
194 .TS
195 l l.
196 1.      Clone on build host (dgit clone)
197 2.      Edit code on build host (edit, git commit)
198 3.      Build package on build host (dgit build)
199 4.      Test package on build host or elsewhere (dpkg -i, test)
200 5.      Upload by invoking dgit rpush on host with your GPG key.
201 .TE
202
203 However, the build-host must be able to ssh to the dgit repos.  If
204 this is not already the case, you must organise it separately, for
205 example by the use of ssh agent forwarding.
206
207 The remaining arguments are treated just as dgit push would handle
208 them.
209
210 build-host and build\-dir can be passed as separate
211 arguments; this is assumed to be the case if the first argument
212 contains no : (except perhaps one in [ ], to support IPv6 address
213 literals).
214
215 You will need similar enough versions of dgit on the build-host and
216 the invocation host.  The build-host needs gnupg installed, with your
217 public key in its keyring (but not your private key, obviously).
218 .TP
219 .B dgit setup-new-tree
220 Configure the current working tree the way that dgit clone would have
221 set it up.  Like running
222 .B dgit setup-useremail
223 and
224 .B setup-mergechangelogs
225 (but only does each thing if dgit is configured to do it automatically).
226 You can use these in any git repository, not just ones used with
227 the other dgit operations.
228 .TP
229 .B dgit setup-useremail
230 Set the working tree's user.name and user.email from the
231 distro-specific dgit configuration
232 .RB ( dgit-distro. \fIdistro\fR .user-name " and " .user-email ),
233 or DEBFULLNAME or DEBEMAIL.
234 .TP
235 .B dgit setup-mergechangelogs
236 Configures a git merge helper for the file
237 .B debian/changelog
238 which uses
239 .BR dpkg-mergechangelogs .
240 .TP
241 .B dgit quilt-fixup
242 `3.0 (quilt)' format source packages need changes representing not
243 only in-tree but also as patches in debian/patches.  dgit quilt-fixup
244 checks whether this has been done; if not, dgit will make appropriate
245 patches in debian/patches and also commit the resulting changes to
246 git.
247
248 This is normally done automatically by dgit build and dgit push.
249
250 dgit will try to turn each relevant commit in your git history into a
251 new quilt patch.  dgit cannot convert nontrivial merges, or certain
252 other kinds of more exotic history.  If dgit can't find a suitable
253 linearisation of your history, by default it will fail, but you can
254 ask it to generate a single squashed patch instead.
255 .TP
256 \fBdgit import-dsc\fR [\fIsub-options\fR] \fI../path/to/.dsc\fR [\fB+\fR|\fB..\fR]branch
257 Import a Debian-format source package,
258 specified by its .dsc,
259 into git,
260 the way dgit fetch would do.
261
262 This does about half the work of dgit fetch:
263 it will convert the .dsc into a new, orphan git branch.
264 Since dgit has no access to a corresponding source package archive
265 or knowledge of the history
266 it does not consider whether this version is newer
267 than any previous import
268 or corresponding git branches;
269 and it therefore does not
270 make a pseudomerge to bind the import
271 into any existing git history.
272
273 Because a .dsc can contain a Dgit field naming a git commit
274 (which you might not have),
275 and specifying where to find that commit
276 (and any history rewrite table),
277 import-dsc might need online access.
278 If this is a problem
279 (or dgit's efforts to find the commit fail),
280 consider --no-chase-dsc-distro
281 or --force-import-dsc-with-dgit-field.
282
283 There is only only sub-option:
284
285 .B --require-valid-signature
286 causes dgit to insist that the signature on the .dsc is valid
287 (using the same criteria as dpkg-source -x).
288 Otherwise, dgit tries to verify the signature but
289 the outcome is reported only as messages to stderr.
290
291 If
292 .I branch
293 is prefixed with
294 .B +
295 then if it already exists, it will be simply ovewritten,
296 no matter its existing contents.
297 If
298 .I branch
299 is prefixed with
300 .B ..
301 then if it already exists
302 and dgit actually imports the dsc
303 (rather than simply reading the git commit out of the Dgit field),
304 dgit will make a pseudomerge
305 so that the result is necessarily fast forward
306 from the existing branch.
307 Otherwise, if branch already exists,
308 dgit will stop with an error message.
309
310 If
311 .I branch
312 does not start with refs/, refs/heads/ is prepended.
313 The specified branch is unconditionally updated.
314 .TP
315 .B dgit version
316 Prints version information and exits.
317 .TP
318 .BI "dgit clone-dgit-repos-server" " destdir"
319 Tries to fetch a copy of the source code for the dgit-repos-server,
320 as actually being used on the dgit git server, as a git tree.
321 .TP
322 .BI "dgit print-dgit-repos-server-source-url"
323 Prints the url used by dgit clone-dgit-repos-server.
324 This is hopefully suitable for use as a git remote url.
325 It may not be useable in a browser.
326 .SH OPTIONS
327 .TP
328 .BR --dry-run " | " -n
329 Go through the motions, fetching all information needed, but do not
330 actually update the output(s).  For push, dgit does
331 the required checks and leaves the new .dsc in a temporary file,
332 but does not sign, tag, push or upload.
333 .TP
334 .BR --damp-run " | " -L
335 Go through many more of the motions: do everything that doesn't
336 involve either signing things, or making changes on the public
337 servers.
338 .TP
339 .BI -k keyid
340 Use
341 .I keyid
342 for signing the tag and the upload.  The default comes from the
343 distro's
344 .B keyid
345 config setting (see CONFIGURATION, below), or failing that, the
346 uploader trailer line in debian/changelog.
347 .TP
348 .BR --no-sign
349 does not sign tags or uploads (meaningful only with push).
350 .TP
351 .TP
352 .BI -p package
353 Specifies that we should process source package
354 .I package
355 rather than looking in debian/control or debian/changelog.
356 Valid with dgit fetch and dgit pull, only.
357 .TP
358 .BR --clean=git " | " -wg
359 Use
360 .BR "git clean -xdf"
361 to clean the working tree,
362 rather than running the package's rules clean target.
363
364 This will delete all files which are not tracked by git.
365 (Including any files you forgot to git add.)
366
367 .BI --clean= ...
368 options other than dpkg-source
369 are useful when the package's clean target is troublesome, or
370 to avoid needing the build-dependencies.
371 .TP
372 .BR --clean=git-ff " | " -wgf
373 Use
374 .BR "git clean -xdff"
375 to clean the working tree.
376 Like
377 git clean -xdf
378 but it also removes any subdirectories containing different git
379 trees (which only unusual packages are likely to create).
380 .TP
381 .BR --clean=check " | " -wc
382 Merely check that the tree is clean (does not contain uncommitted
383 files).
384 Avoids running rules clean,
385 and can avoid needing the build-dependencies.
386 .TP
387 .BR --clean=none " | " -wn
388 Do not clean the tree, nor check that it is clean.
389 Avoids running rules clean,
390 and can avoid needing the build-dependencies.
391 If there are
392 files which are not in git, or if the build creates such files, a
393 subsequent dgit push will fail.
394 .TP
395 .BR --clean=dpkg-source " | " -wd
396 Use dpkg-buildpackage to do the clean, so that the source package
397 is cleaned by dpkg-source running the package's clean target.
398 This is the default.
399 Requires the package's build dependencies.
400 .TP
401 .BR --clean=dpkg-source-d " | " -wdd
402 Use
403 .B dpkg-buildpackage -d
404 to do the clean,
405 so that the source package
406 is cleaned by dpkg-source running the package's clean target.
407 The build-dependencies are not checked (due to
408 .BR -d ),
409 which violates policy, but may work in practice.
410 .TP
411 .BR -N " | " --new
412 The package is or may be new in this suite.  Without this, dgit will
413 refuse to push.  It may (for Debian, will) be unable to access the git
414 history for any packages which have been newly pushed and have not yet
415 been published.
416 .TP
417 .BR --ignore-dirty
418 Do not complain if the working tree does not match your git HEAD.
419 This can be useful with build, if you plan to commit later.  (dgit
420 push will still ensure that the .dsc you upload and the git tree
421 you push are identical, so this option won't make broken pushes.)
422 .TP
423 .BR --overwrite =\fIprevious-version\fR
424 Declare that even though your git branch is not a descendant
425 of the version in the archive
426 according to the revision history,
427 it really does contain
428 all the (wanted) changes from that version.
429
430 This option is useful if you are the maintainer, and you have
431 incorporated NMU changes into your own git workflow in a way that
432 doesn't make your branch a fast forward from the NMU.
433
434 .I previous-version
435 ought to be the version currently in the archive.  If
436 .I previous-version
437 is not
438 specified, dgit will check that the version in the archive is
439 mentioned in your debian/changelog.
440 (This will avoid losing
441 changes unless someone committed to git a finalised changelog
442 entry, and then made later changes to that version.)
443
444 dgit push --overwrite
445 will make a
446 pseudo-merge (that is, something that looks like the result
447 of git merge -s ours) to stitch the archive's version into your own
448 git history, so that your push is a fast forward from the archive.
449
450 (In quilt mode
451 .BR gbp ", " dpm " or " unpatched ,
452 implying a split between the dgit view and the
453 maintainer view, the pseudo-merge will appear only in the dgit view.)
454 .TP
455 .BR --delayed =\fIdays\fR
456 Upload to a DELAYED queue.
457
458 .B WARNING:
459 If the maintainer responds by cancelling
460 your upload from the queue,
461 and does not make an upload of their own,
462 this will not rewind the git branch on the dgit git server.
463 Other dgit users will then see your push
464 (with a warning message from dgit)
465 even though the maintainer wanted to abolish it.
466 Such users might unwittingly reintroduce your changes.
467
468 If this situation arises,
469 someone should make a suitable dgit push
470 to update the contents of dgit-repos
471 to a version without the controversial changes.
472 .TP
473 .BR --no-chase-dsc-distro
474 Tells dgit not to look online
475 for additional git repositories
476 containing information about a particular .dsc being imported.
477 Chasing is the default.
478
479 For most operations
480 (such as fetch and pull),
481 disabling chasing
482 means dgit will access only the git server
483 for the distro you are directly working with,
484 even if the .dsc was copied verbatim from another distro.
485 For import-dsc,
486 disabling chasing
487 means dgit will work completely offline.
488
489 Disabling chasing can be hazardous:
490 if the .dsc names a git commit which has been rewritten
491 by those in charge of the distro,
492 this option may prevent that rewrite from being effective.
493 Also,
494 using it can mean that
495 dgit fails to find necessary git commits.
496 .TP
497 .BR --dgit-view-save= \fIbranch\fR|\fIref\fR
498 Specifies that when a split view quilt mode is in operation,
499 and dgit calculates
500 (or looks up in its cache)
501 a dgit view corresponding to your HEAD,
502 the dgit view will be left in
503 .IR ref .
504 The specified ref is unconditionally overwritten,
505 so don't specify a branch you want to keep.
506
507 This option is effective only with the following operations:
508 quilt-fixup; push; all builds.
509 And it is only effective with
510 --[quilt=]gbp,
511 --[quilt=]dpm,
512 --quilt=unpatched.
513
514 If ref does not start with refs/
515 it is taken to to be a branch -
516 i.e. refs/heads/ is prepended.
517 .TP
518 .BI --deliberately- something
519 Declare that you are deliberately doing
520 .IR something .
521 This can be used to override safety catches, including safety catches
522 which relate to distro-specific policies.
523 The use of --deliberately is declared and published in the signed tags
524 generated for you by dgit,
525 so that the archive software can give effect to your intent,
526 and
527 for the benefit humans looking at the history.
528 The meanings of
529 .IR something s
530 understood in the context of Debian are discussed below:
531 .TP
532 .BR --deliberately-not-fast-forward
533 Declare that you are deliberately rewinding history.  When pushing to
534 Debian, use this when you are making a renewed upload of an entirely
535 new source package whose previous version was not accepted for release
536 from NEW because of problems with copyright or redistributibility.
537 .TP
538 .BR --deliberately-include-questionable-history
539 Declare that you are deliberately including, in the git history of
540 your current push, history which contains a previously-submitted
541 version of this package which was not approved (or has not yet been
542 approved) by the ftpmasters.  When pushing to Debian, only use this
543 option after verifying that: none of the rejected-from-NEW (or
544 never-accepted) versions in the git history of your current push, were
545 rejected by ftpmaster for copyright or redistributability reasons.
546 .TP
547 .BR --deliberately-fresh-repo
548 Declare that you are deliberately rewinding history and want to
549 throw away the existing repo.  Not relevant when pushing to Debian,
550 as the Debian server will do this automatically when necessary.
551 .TP
552 .BR --quilt=linear
553 When fixing up source format `3.0 (quilt)' metadata, insist on
554 generating a linear patch stack: one new patch for each relevant
555 commit.
556 If such a stack cannot be generated, fail.
557 This is the default for Debian.
558
559 HEAD should be a series of plain commits
560 (not touching debian/patches/),
561 and pseudomerges,
562 with as ancestor a patches-applied branch.
563 .TP
564 .BR --quilt=auto
565 When fixing up source format `3.0 (quilt)' metadata, prefer to
566 generate a linear patch stack
567 (as with --quilt=auto)
568 but if that doesn't seem possible,
569 try to generate a single squashed patch for all the changes made in git
570 (as with --quilt=smash).
571 This is not a good idea for an NMU in Debian.
572 .TP
573 .BR --quilt=smash
574 When fixing up source format `3.0 (quilt)' metadata,
575 generate a single additional patch for all the changes made in git.
576 This is not a good idea for an NMU in Debian.
577
578 (If HEAD has any in-tree patches already, they must apply cleanly.
579 This will be the case for any trees produced by dgit fetch or clone;
580 if you do not change the upstream version
581 nor make changes in debian/patches,
582 it will remain true.)
583 .TP
584 .BR --quilt=nofix
585 Check whether source format `3.0 (quilt)' metadata would need fixing
586 up, but, if it does, fail.  You must then fix the metadata yourself
587 somehow before pushing.  (NB that dpkg-source --commit will not work
588 because the dgit git tree does not have a
589 .B .pc
590 directory.)
591 .TP
592 .BR --quilt=nocheck " | " --no-quilt-fixup
593 Do not check whether up source format `3.0 (quilt)' metadata needs
594 fixing up.  If you use this option and the metadata did in fact need
595 fixing up, dgit push will fail.
596 .TP
597 .BR -- [ quilt= ] gbp " | " -- [ quilt= ] dpm " | " --quilt=unapplied
598 Tell dgit that you are using a nearly-dgit-compatible git branch,
599 aka a
600 .BR "maintainer view" ,
601 and
602 do not want your branch changed by dgit.
603
604 .B --gbp
605 (short for
606 .BR --quilt=gbp )
607 is for use with git-buildpackage.
608 Your HEAD is expected to be
609 a patches-unapplied git branch, except that it might contain changes
610 to upstream .gitignore files.  This is the default for dgit gbp-build.
611
612 .B --dpm
613 (short for
614 .BR --quilt=dpm )
615 is for use with git-dpm.
616 Your HEAD is expected to be
617 a patches-applied git branch,
618 except that it might contain changes to upstream .gitignore files.
619
620 .B --quilt=unapplied
621 specifies that your HEAD is a patches-unapplied git branch (and
622 that any changes to upstream .gitignore files are represented as
623 patches in debian/patches).
624
625 With --quilt=gbp|dpm|unapplied,
626 dgit push (or precursors like quilt-fixup and build) will automatically
627 generate a conversion of your git branch into the right form.
628 dgit push will push the
629 dgit-compatible form (the
630 .BR "dgit view" )
631 to the dgit git server.
632 The dgit view will be visible to you
633 in the dgit remote tracking branches, but your own branch will
634 not be modified.
635 dgit push will create a tag
636 .BI debian/ version
637 for the maintainer view, and the dgit tag
638 .BI archive/debian/ version
639 for the dgit view.
640 dgit quilt-fixup will merely do some checks,
641 and cache the maintainer view.
642
643 .B If you have a branch like this it is essential to specify the appropriate --quilt= option!
644 This is because it is not always possible to tell: a patches-unapplied
645 git branch of a package with one patch, for example, looks very like
646 a patches-applied branch where the user has used git revert to
647 undo the patch, expecting to actually revert it.
648 However, if you fail to specify the right \-\-quilt option,
649 and you aren't too lucky, dgit will notice the problem and stop,
650 with a useful hint. 
651 .TP
652 .BR -d "\fIdistro\fR | " --distro= \fIdistro\fR
653 Specifies that the suite to be operated on is part of distro
654 .IR distro .
655 This overrides the default value found from the git config option
656 .BR dgit-suite. \fIsuite\fR .distro .
657 The only effect is that other configuration variables (used
658 for accessing the archive and dgit-repos) used are
659 .BR dgit-distro. \fIdistro\fR .* .
660
661 If your suite is part of a distro that dgit already knows about, you
662 can use this option to make dgit work even if your dgit doesn't know
663 about the suite.  For example, specifying
664 .B -ddebian
665 will work when the suite is an unknown suite in the Debian archive.
666
667 To define a new distro it is necessary to define methods and URLs
668 for fetching (and, for dgit push, altering) a variety of information both
669 in the archive and in dgit-repos.
670 How to set this up is not yet documented.
671 .TP
672 .BI -C changesfile
673 Specifies the .changes file which is to be uploaded.  By default
674 dgit push looks for single .changes file in the parent directory whose
675 filename suggests it is for the right package and version.
676
677 If the specified
678 .I changesfile
679 pathname contains slashes, the directory part is also used as
680 the value for
681 .BR --build-products-dir ;
682 otherwise, the changes file is expected in that directory (by
683 default, in
684 .BR .. ).
685 .TP
686 .B --rm-old-changes
687 When doing a build, delete any changes files matching
688 .IB package _ version _*.changes
689 before starting.  This ensures that
690 dgit push (and dgit sbuild) will be able to unambigously
691 identify the relevant changes files from the most recent build, even
692 if there have been previous builds with different tools or options.
693 The default is not to remove, but
694 .B \-\-no-rm-old-changes
695 can be used to override a previous \-\-rm-old-changes
696 or the .rm-old-changes configuration setting.
697 .TP
698 .BI --build-products-dir= directory
699 Specifies where to find the built files to be uploaded.
700 By default, dgit looks in the parent directory
701 .RB ( .. ).
702 .TP
703 .BI --no-rm-on-error
704 Do not delete the destination directory if clone fails.
705 .TP
706 .BI --dep14tag
707 Generates a DEP-14 tag (eg
708 .BR debian/ \fIversion\fR)
709 as well as a dgit tag (eg
710 .BR archive/debian/ \fIversion\fR)
711 where possible.  This is the default.
712 .TP
713 .BI --no-dep14tag
714 Do not generate a DEP-14 tag, except in split quilt view mode.
715 (On servers where only the old tag format is supported,
716 the dgit tag will have the DEP-14 name.
717 This option does not prevent that.)
718 .TP
719 .BI --dep14tag-always
720 Insist on generating a DEP-14 tag
721 as well as a dgit tag.
722 If the server does not support that, dgit push will fail.
723 .TP
724 .BI -D
725 Prints debugging information to stderr.  Repeating the option produces
726 more output (currently, up to -DDDD is meaningfully different).
727 .TP
728 .BI -c name = value
729 Specifies a git configuration option, to be used for this run.
730 dgit itself is also controlled by git configuration options.
731 .TP
732 .RI \fB-v\fR version "|\fB_\fR | " \fB--since-version=\fR version |\fB_\fR
733 Specifies the
734 .BI -v version
735 option to pass to dpkg-genchanges, during builds.  Changes (from
736 debian/changelog) since this version will be included in the built
737 changes file, and hence in the upload.  If this option is not
738 specified, dgit will query the archive and use the latest version
739 uploaded to the intended suite.
740
741 Specifying
742 .B _
743 inhibits this, so that no -v option will be passed to dpkg-genchanges
744 (and as a result, only the last stanza from debian/changelog will
745 be used for the build and upload).
746 .TP
747 .RI \fB-m\fR maintaineraddress
748 Passed to dpkg-genchanges (eventually).
749 .TP
750 .RI \fB--ch:\fR option
751 Specifies a single additional option to pass, eventually, to
752 dpkg-genchanges.
753
754 Options which are safe to pass include
755 .BR -C
756 (and also
757 .BR "-si -sa -sd"
758 although these should never be necessary with Debian since dgit
759 automatically calculates whether .origs need to be uploaded.)
760
761 For other options the caveat below applies.
762 .TP
763 .RI \fB--curl:\fR option " | \fB--dput:\fR" option " |..."
764 Specifies a single additional option to pass to
765 .BR curl ,
766 .BR dput ,
767 .BR debsign ,
768 .BR dpkg-source ,
769 .BR dpkg-buildpackage ,
770 .BR dpkg-genchanges ,
771 .BR sbuild ,
772 .BR ssh ,
773 .BR dgit ,
774 .BR apt-get ,
775 .BR apt-cache ,
776 .BR gbp-pq ,
777 .BR gbp-build ,
778 or
779 .BR mergechanges .
780 Can be repeated as necessary.
781
782 Use of this ability should not normally be necessary.
783 It is provided for working around bugs,
784 or other unusual situations.
785 If you use these options,
786 you may violate dgit's assumptions
787 about the behaviour of its subprograms
788 and cause lossage.
789
790 For dpkg-buildpackage, dpkg-genchanges, mergechanges and sbuild,
791 the option applies only when the program is invoked directly by dgit.
792 Usually, for passing options to dpkg-genchanges, you should use
793 .BR --ch: \fIoption\fR.
794
795 Specifying --git is not effective for some lower-level read-only git
796 operations performed by dgit, and also not when git is invoked by
797 another program run by dgit.
798
799 See notes below regarding ssh and dgit.
800
801 NB that --gpg:option is not supported (because debsign does not
802 have that facility).
803 But see
804 .B -k
805 and the
806 .B keyid
807 distro config setting.
808 .TP
809 .RI \fB--curl=\fR program " | \fB--dput=\fR" program  " |..."
810 Specifies alternative programs to use instead of
811 .BR curl ,
812 .BR dput ,
813 .BR debsign ,
814 .BR dpkg-source ,
815 .BR dpkg-buildpackage ,
816 .BR dpkg-genchanges ,
817 .BR sbuild ,
818 .BR gpg ,
819 .BR ssh ,
820 .BR dgit ,
821 .BR apt-get ,
822 .BR apt-cache ,
823 .BR git ,
824 .BR gbp-pq ,
825 .BR gbp-build ,
826 or
827 .BR mergechanges .
828
829 For
830 .BR dpkg-buildpackage ,
831 .BR dpkg-genchanges ,
832 .B mergechanges
833 and
834 .BR sbuild ,
835 this applies only when the program is invoked directly by dgit.
836
837 For
838 .BR dgit ,
839 specifies the command to run on the remote host when dgit
840 rpush needs to invoke a remote copy of itself.  (dgit also reinvokes
841 itself as the EDITOR for dpkg-source --commit; this is done using
842 argv[0], and is not affected by --dgit=).
843
844 .BR gbp-build 's
845 value
846 is used instead of gbp build or git-buildpackage.  (The default is
847 the latter unless the former exists on PATH.)
848 .BR gbp-pq 's
849 value
850 is used instead of gbp pq.
851 In both cases,
852 unusually, the specified value is split on whitespace
853 to produce a command and possibly some options and/or arguments.
854
855 For
856 .BR ssh ,
857 the default value is taken from the
858 .B DGIT_SSH
859 or
860 .B GIT_SSH
861 environment variables, if set (see below).  And, for ssh, when accessing the
862 archive and dgit-repos, this command line setting is overridden by the
863 git config variables
864 .BI dgit-distro. distro .ssh
865 and
866 .B .dgit.default.ssh
867 (which can in turn be overridden with -c).  Also, when dgit is using
868 git to access dgit-repos, only git's idea of what ssh to use (eg,
869 .BR GIT_SSH )
870 is relevant.
871 .TP
872 .BI --existing-package= package
873 dgit push needs to canonicalise the suite name.  Sometimes, dgit
874 lacks a way to ask the archive to do this without knowing the
875 name of an existing package.  Without --new we can just use the
876 package we are trying to push.  But with --new that will not work, so
877 we guess
878 .B dpkg
879 or use the value of this option.  This option is not needed with the
880 default mechanisms for accessing the archive.
881 .TP
882 .BR -h | --help
883 Print a usage summary.
884 .TP
885 .BI --initiator-tempdir= directory
886 dgit rpush uses a temporary directory on the invoking (signing) host.
887 This option causes dgit to use
888 .I directory
889 instead.  Furthermore, the specified directory will be emptied,
890 removed and recreated before dgit starts, rather than removed
891 after dgit finishes.  The directory specified must be an absolute
892 pathname.
893 .TP
894 .BI --force- something
895 Instructs dgit to try to proceed despite detecting
896 what it thinks is going to be a fatal problem.
897 .B This is probably not going to work.
898 These options are provided as an escape hatch,
899 in case dgit is confused.
900 (They might also be useful for testing error cases.)
901 .TP
902 .B --import-dsc-with-dgit-field
903 Tell dgit import-dsc to treat a .dsc with a Dgit field
904 like one without it.
905 The result is a fresh import,
906 discarding the git history
907 that the person who pushed that .dsc was working with.
908 .TP
909 .B --force-unrepresentable
910 Carry on even if
911 dgit thinks that your git tree contains changes
912 (relative to your .orig tarballs)
913 which dpkg-source is not able to represent.
914 Your build or push will probably fail later.
915 .TP
916 .B --force-changes-origs-exactly
917 Use the set of .origs specified in your .changes, exactly,
918 without regard to what is in the archive already.
919 The archive may well reject your upload.
920 .TP
921 .B --force-unsupported-source-format
922 Carry on despite dgit not understanding your source package format.
923 dgit will probably mishandle it.
924 .TP
925 .B --force-dsc-changes-mismatch
926 Do not check whether .dsc and .changes match.
927 The archive will probably reject your upload.
928 .TP
929 .BR --force-import-gitapply-absurd " | " --force-import-gitapply-no-absurd
930 Force on or off the use of the absurd git-apply emulation
931 when running gbp pq import
932 when importing a package from a .dsc.
933 See Debian bug #841867.
934 .SH CONFIGURATION
935 dgit can be configured via the git config system.
936 You may set keys with git-config (either in system-global or per-tree
937 configuration), or provide
938 .BI -c key = value
939 on the dgit command line.
940 .LP
941 Settings likely to be useful for an end user include:
942 .TP
943 .BR dgit-suite. \fIsuite\fR .distro " \fIdistro\fR"
944 Specifies the distro for a suite.  dgit keys off the suite name (which
945 appears in changelogs etc.), and uses that to determine the distro
946 which is involved.  The config used is thereafter that for the distro.
947
948 .I suite
949 may be a glob pattern.
950 .TP
951 .BI dgit.default.distro " distro"
952 The default distro for an unknown suite.
953 .TP
954 .BI dgit.default.default-suite " suite"
955 The default suite (eg for clone).
956 .TP
957 .BR dgit.default. *
958 for each
959 .BR dgit-distro. \fIdistro\fR . *,
960 the default value used if there is no distro-specific setting.
961 .TP
962 .BR dgit-distro. \fIdistro\fR .clean-mode
963 One of the values for the command line --clean= option; used if
964 --clean is not specified.
965 .TP
966 .BR dgit-distro. \fIdistro\fR .quilt-mode
967 One of the values for the command line --quilt= option; used if
968 --quilt is not specified.
969 .TP
970 .BR dgit-distro. \fIdistro\fR .rm-old-changes
971 Boolean, used if neither \-\-rm-old-changes nor \-\-no-rm-old-changes
972 is specified.  The default is not to remove.
973 .TP
974 .BR dgit-distro. \fIdistro\fR .readonly " " auto | a " | " true | t | y | 1 " | " false | f | n | 0
975 Whether you have push access to the distro.
976 For Debian, it is OK to use auto, which uses readonly mode if you are
977 not pushing right now;
978 but, setting this to false will avoid relying on the mirror of the dgit
979 git repository server.
980 .TP
981 .BI dgit-distro. distro .keyid
982 See also
983 .BR -k .
984 .TP
985 .BI dgit-distro. distro .mirror " url"
986 .TP
987 .BI dgit-distro. distro .username
988 Not relevant for Debian.
989 .TP
990 .BI dgit-distro. distro .upload-host
991 Might be useful if you have an intermediate queue server.
992 .TP
993 .BI dgit-distro. distro .user-name " " dgit-distro. distro .user-email
994 Values to configure for user.name and user.email in new git trees.  If
995 not specified, the DEBFULLNAME and DEBEMAIL environment variables are
996 used, respectively.  Only used if .setup-usermail is not disabled.
997 .TP
998 .BI dgit-distro. distro .setup-useremail
999 Whether to set user.name and user.email in new git trees.
1000 True by default.  Ignored for dgit setup-setup-useremail, which does it anyway.
1001 .TP
1002 .BI dgit-distro. distro .setup-mergechangelogs
1003 Whether to setup a merge driver which uses dpkg-mergechangelogs for
1004 debian/changelog.  True by default.  Ignored for dgit
1005 setup-mergechangelogs, which does it anyway.
1006 .TP
1007 .BI dgit-distro. distro .cmd- cmd
1008 Program to use instead of
1009 .IR cmd .
1010 Works like
1011 .BR -- \fIcmd\fR = "... ."
1012 .TP
1013 .BI dgit-distro. distro .opts- cmd
1014 Extra options to pass to
1015 .IR cmd .
1016 Works like
1017 .BR -- \fIcmd\fR : "... ."
1018 To pass several options, configure multiple values in git config
1019 (with git config --add).  The options for
1020 .BI dgit.default.opts- cmd
1021 .BI dgit-distro. distro /push.opts- cmd
1022 and are all used, followed by options from dgit's command line.
1023 .SH ACCESS CONFIGURATION
1024 There are many other settings which specify how a particular distro's
1025 services (archive and git) are provided.  These should not normally be
1026 adjusted, but are documented for the benefit of distros who wish to
1027 adopt dgit.
1028 .TP
1029 .BI dgit-distro. distro .nominal-distro
1030 Shown in git tags, Dgit fields, and so on.
1031 .TP
1032 .BI dgit-distro. distro .alias-canon
1033 Used for all access configuration lookup.
1034 .TP
1035 .BR dgit-distro. \fIdistro\fR /push. *
1036 If set, overrides corresponding non \fB/push\fR config when
1037 .BR readonly=false ,
1038 or when pushing and
1039 .BR readonly=auto .
1040 .TP
1041 .BI dgit-distro. distro .git-url
1042 .TP
1043 .BR dgit-distro. \fIdistro\fR .git-url [ -suffix ]
1044 .TP
1045 .BI dgit-distro. distro .git-proto
1046 .TP
1047 .BI dgit-distro. distro .git-path
1048 .TP
1049 .BR dgit-distro. \fIdistro\fR .git-check " " true | false | url | ssh-cmd
1050 .TP
1051 .BI dgit-distro. distro .git-check-suffix
1052 .TP
1053 .BR dgit-distro. \fIdistro\fR .diverts.divert " " new-distro | / \fIdistro-suffix\fR
1054 .TP
1055 .BI dgit-distro. distro .git-create " " ssh-cmd | true
1056 .TP
1057 .BR dgit-distro. \fIdistro\fR .archive-query " " ftpmasterapi: " | " madison: "\fIdistro\fR | " dummycat: "\fI/path\fR  | " sshpsql: \fIuser\fR @ \fIhost\fR : \fIdbname\fR
1058 .TP
1059 .BR dgit-distro. \fIdistro\fR .archive-query- ( url | tls-key | curl-ca-args )
1060 .TP
1061 .BI dgit-distro. distro .madison-distro
1062 .TP
1063 .BI dgit-distro. distro .archive-query-default-component
1064 .TP
1065 .BI dgit-distro. distro .dgit-tag-format
1066 .TP
1067 .BR dgit-distro. \fIdistro\fR .dep14tag " " want | no | always
1068 .TP
1069 .BI dgit-distro. distro .ssh
1070 .TP
1071 .BI dgit-distro. distro .sshpsql-dbname
1072 .TP
1073 .BR dgit-distro. \fIdistro\fR . ( git | sshpsql ) - ( user | host | user-force )
1074 .TP
1075 .BI dgit-distro. distro .backports-quirk
1076 .TP
1077 .BI dgit-distro. distro .rewrite-map-enable
1078 .TP
1079 .BI dgit.default.old-dsc-distro
1080 .TP
1081 .BI dgit.dsc-url-proto-ok. protocol
1082 .TP
1083 .BI dgit.dsc-url-proto-ok.bad-syntax
1084 .TP
1085 .BI dgit.default.dsc-url-proto-ok
1086 .SH ENVIRONMENT VARIABLES
1087 .TP
1088 .BR DGIT_SSH ", " GIT_SSH
1089 specify an alternative default program (and perhaps arguments) to use
1090 instead of ssh.  DGIT_SSH is consulted first and may contain arguments;
1091 if it contains any whitespace will be passed to the shell.  GIT_SSH
1092 specifies just the program; no arguments can be specified, so dgit
1093 interprets it the same way as git does.
1094 See
1095 also the --ssh= and --ssh: options.
1096 .TP
1097 .BR DEBEMAIL ", " DEBFULLNAME
1098 Default git user.email and user.name for new trees.  See
1099 .BR "dgit setup-new-tree" .
1100 .TP
1101 .BR gpg ", " dpkg- "..., " debsign ", " git ", " curl ", " dput ", " LWP::UserAgent
1102 and other subprograms and modules used by dgit are affected by various
1103 environment variables.  Consult the documentaton for those programs
1104 for details.
1105 .SH BUGS
1106 There should be
1107 a `dgit rebase-prep' command or some such to turn a
1108 fast-forwarding branch containing pseudo-merges
1109 back into a rebasing patch stack.
1110 It might have to leave a note
1111 for a future dgit push.
1112
1113 If the dgit push fails halfway through,
1114 it is not necessarily restartable and
1115 idempotent.
1116 It would be good to check that the proposed signing key is
1117 available before starting work.
1118
1119 dgit's build functions, and dgit push, may make changes to
1120 your current HEAD.  Sadly this is necessary for packages in the `3.0
1121 (quilt)' source format.  This is ultimately due to what I consider
1122 design problems in quilt and dpkg-source.
1123
1124 --dry-run does not always work properly, as not doing some of the git
1125 fetches may result in subsequent actions being different.  Doing a
1126 non-dry-run dgit fetch first will help.
1127 --damp-run is likely to work much better.
1128 .SH SEE ALSO
1129 \fBdgit\fP(7),
1130 \fBdgit-*\fP(7),
1131 \fBcurl\fP(1),
1132 \fBdput\fP(1),
1133 \fBdebsign\fP(1),
1134 \fBgit-config\fP(1),
1135 \fBgit-buildpackage\fP(1),
1136 \fBdpkg-buildpackage\fP(1),
1137 .br
1138 https://browse.dgit.debian.org/