1 .TH dgit 1 "" "Debian Project" "dgit"
3 dgit \- git integration with the Debian archive
7 [\fIdgit\-opts\fP] \fBclone\fP [\fIdgit\-opts\fP]
8 \fIpackage\fP [\fIsuite\fP] [\fB./\fP\fIdir|\fB/\fP\fIdir]
11 [\fIdgit\-opts\fP] \fBfetch\fP|\fBpull\fP [\fIdgit\-opts\fP]
15 [\fIdgit\-opts\fP] \fBbuild\fP|\fBsbuild\fP
19 [\fIdgit\-opts\fP] \fBpush\fP [\fIdgit\-opts\fP]
23 [\fIdgit\-opts\fP] \fIaction\fR ...
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
33 which lives outside the Debian archive (currently, on Alioth).
35 The usual workflow is: 1. clone or fetch; 2. make and commit changes
36 in git as desired; 3. run dgit build or dgit sbuild, or generate the
37 source and binary packages for upload some other way; 4. do
38 pre-upload tests of the proposed upload; 5. run dgit push.
40 \fBdgit clone\fR \fIpackage\fP [\fIsuite\fP] [\fB./\fP\fIdir|\fB/\fP\fIdir]
41 Consults the archive and dgit-repos to construct the git view of
48 in a new directory (named
51 also, downloads any necessary orig tarballs.
53 The suite's git tip is
54 left on the local branch
56 ready for work, and on the corresponding dgit remote tracking branch.
59 remote will be set up to point to the package's dgit-repos tree
60 for the distro to which
64 \fBdgit fetch\fR [\fIsuite\fP]
65 Consults the archive and git-repos to update the git view of
66 history for a specific suite (and downloads any necessary orig
67 tarballs), and updates the remote tracking branch
68 .BR remotes/dgit/ \fIsuite\fR.
69 If the current branch is
71 then dgit fetch defaults to
73 otherwise it parses debian/changelog and uses the suite specified
76 \fBdgit pull\fR [\fIsuite\fP]
77 Does dgit fetch, and then merges the new head of the remote tracking
79 .BI remotes/dgit/ suite
80 into the current branch.
85 with some suitable options. Options and argumments after build
86 will be passed on to git-buildpackage. It is not necessary to use
87 dgit build when using dgit; it is OK to use any approach which ensures
88 that the generated source package corresponds to the relevant git
89 commit. Tagging and signing should be left to dgit push.
92 Constructs the source package, and uses sbuild to do a binary
93 build, and uses mergechanges to merge the source and binary
94 changes files. Options and argumments after sbuild will be passed on
95 to sbuild. Changes files matching
96 .IB package _ version _*.changes
97 in the parent directory will be removed; the output is left in
98 .IR package \fB_\fR version \fB_multi.changes\fR.
101 Does an `upload', pushing the current HEAD to the archive (as a source
102 package) and to dgit-repos (as git commits). The package must already
103 have been built ready for upload, with the .dsc and .changes
104 left in the parent directory.
106 In more detail: dgit push checks that the current HEAD corresponds to
107 the .dsc. It then pushes the HEAD to the suite's dgit-repos branch,
108 makes a signed git tag, edits the .dsc to contain the dgit metadata
109 field, runs debsign to sign the upload (.dsc and .changes), pushes the
110 signed tag, and finally uses dput to upload the .changes to the
113 For a format `3.0 (quilt)' source package, dgit push
114 may also have to make a commit on your current branch to contain
115 quilt metadata. It will do this automatically if necessary.
116 You can explicitly request that dgit do just this
119 dgit push always uses the package, suite and version specified in the
120 debian/changelog and the .dsc, which must agree.
122 If dgit push fails while uploading, it is fine to simply retry the
123 dput on the .changes file at your leisure.
126 Looks to see if there is quilt patch metadata left over by dpkg-source
127 -b, and if so makes a git commit of it. This is normally done
128 automatically by dgit push. dgit quilt-fixup takes no additional
129 arguments. Note that it will only process a patch generated by
130 dpkg-source for the most recent version (according to the
133 It is not normally necessary to run dgit quilt-fixup explicitly;
134 where necessary it is done as part of dgit push.
135 .SH WORKFLOW - SIMPLE
136 It is always possible with dgit to clone or fetch a package, make
137 changes in git (using git-commit) on the suite branch
138 .RB ( "git checkout dgit/" \fIsuite\fR)
139 and then dgit push. You can use whatever gitish techniques you like
140 to construct the commit to push; the only requirement is that it is a
141 descendant of the state of the archive, as provided by dgit in the
142 remote tracking branch
143 .BR remotes/dgit/ \fIsuite\fR.
145 If you are lucky the other uploaders have also used dgit and
146 integrated the other relevant git history; if not you can fetch it
147 into your tree and cherry-pick etc. as you wish.
148 .SH WORKFLOW - INTEGRATING BETWEEN DGIT AND OTHER GIT HISTORY
149 If you are the maintainer of a package dealing with uploads made
150 without dgit, you will probably want to merge the synthetic commits
151 (made by dgit to represent the uploads) into your git history.
152 Normally you can just merge the dgit branch into your own master, or
153 indeed if you do your work on the dgit local suite branch
155 you can just use dgit pull.
157 However the first time dgit is used it will generate a new origin
158 commit from the archive which won't be linked into the rest of your
159 git history. You will need to merge this.
161 If last upload was in fact made with git, you should usually proceed
162 as follows: identify the commit which was actually used to build the
163 package. (Hopefully you have a tag for this.) Check out the dgit
165 .RB ( "git checkout dgit/" \fIsuite\fR)
166 and merge that other commit
167 .RB ( "git merge debian/" \fIversion\fR).
168 Hopefully this merge will be trivial because the two trees should
169 be the same. The resulting branch head can be merged into your
171 .RB ( "git checkout master && git merge dgit/" \fIsuite\fR).
173 If last upload was not made with git, a different approach is required
174 to start using dgit. First, do
176 (or clone) to obtain a git history representation of what's in the
177 archive and record it in the
178 .BI remotes/dgit/ suite
179 tracking branch. Then somehow, using your other git history
180 plus appropriate diffs and cherry picks from the dgit remote tracking
181 branch, construct a git commit whose tree corresponds to the tree to use for the
182 next upload. If that commit-to-be-uploaded is not a descendant of the
183 dig remote tracking branch, check it out and say
184 .BR "git merge -s ours remotes/dgit/" \fIsuite\fR;
185 that tells git that we are deliberately throwing away any differences
186 between what's in the archive and what you intend to upload.
189 to actually upload the result.
191 You may use any suitable git workflow with dgit, provided you
192 satisfy dgit's requirements:
194 dgit maintains a pseudo-remote called
196 with one branch per suite. This remote cannot be used with
201 repository for each package contains one ref per suite named
202 \fBrefs/dgit/\fR\fIsuite\fR. These should be pushed to only by
203 dgit. They are fast forwarding. Each push on this branch
204 corresponds to an upload (or attempted upload).
206 However, it is perfectly fine to have other branches in dgit-repos;
207 normally the dgit-repos repo for the package will be accessible via
208 the remote name `origin'.
210 dgit push will also (by default) make signed tags called
212 and push them to dgit-repos, but nothing depends on these tags
215 dgit push can operate on any commit which is a descendant of the
216 current dgit/suite tip in dgit-repos.
218 Uploads made by dgit contain an additional field
220 in the source package .dsc. (This is added by dgit push.)
221 This specifies a commit (an ancestor of the dgit/suite
222 branch) whose tree is identical to the unpacked source upload.
224 Uploads not made by dgit are represented in git by commits which are
225 synthesised by dgit. The tree of each such commit corresponds to the
226 unpacked source; there is an origin commit with the contents, and a
227 psuedo-merge from last known upload - that is, from the contents of
228 the dgit/suite branch.
230 dgit expects repos that it works with to have a
232 remote. This refers to the well-known dgit-repos location
233 (currently, the dgit-repos project on Alioth). dgit fetch updates
234 the remote tracking branch for dgit/suite.
236 dgit does not (currently) represent the orig tarball(s) in git; nor
237 does it represent the patch statck of a `3.0 (quilt)' package. The
238 orig tarballs are downloaded and kept in the parent directory, as with
239 a traditional (non-gitish) dpkg-source workflow.
241 To a user looking at the archive, changes pushed using dgit look like
242 changes made in an NMU: in a `3.0 (quilt)' package the delta from the
243 previous upload is recorded in a new patch constructed by dpkg-source.
244 .SH PACKAGE SOURCE FORMATS
245 If you are not the maintainer, you do not need to worry about the
246 source format of the package. You can just make changes as you like
247 in git. If the package is a `3.0 (quilt)' package, the patch stack
248 will usually not be represented in the git history.
250 If you are the maintainer of a non-native package, you currently have
251 two sensible options:
253 Firstly, you can regard your git history as primary, and the archive
254 as an export format. For example, you could maintain topic branches
255 in git and a fast-forwarding release branch; or you could do your work
256 directly in a merging way on the
258 branches. If you do this you should probably use a `1.0' format
259 source package. In the archive, the delta between upstream will be
260 represented in the single Debian patch.
262 Secondly, you can regard your quiltish patch stack in the archive as
263 primary. You will have to use other tools besides dgit to import and
264 export this patch stack. For `3.0 (quilt)' packages, dgit has to do
265 more work to work around some braindamage in way dpkg-source handles
266 changes made to this format. See also the BUGS section. We recommend
267 against the use of `3.0 (quilt)'.
271 Go through the motions, fetching all information needed, but do not
272 actually update the output(s). For push, dgit does
273 the required checks and leaves the new .dsc in a temporary file,
274 but does not sign, tag, push or upload.
279 for signing the tag and the upload.
282 does not sign tags or uploads (meaningful only with push).
286 Specifies that we should process source package
288 rather than looking in debian/control or debian/changelog.
289 Valid with dgit fetch and dgit pull, only.
292 The package may be new in this suite. Without this, dgit will
296 Prints debugging information to stderr. Repeating the option produces
297 more output (currently, up to -DD is meaningfully different).
300 Specifies a git configuration option. dgit itself is also controlled
301 by git configuration options.
303 .RI \fB--dget=\fR program |\fB--dput=\fR program |...
304 Specifies alternative programs to use instead of
308 .BR dpkg-buildpackage
313 .RI \fB--dget:\fR option |\fB--dput:\fR option |...
314 Specifies a single additional option to pass to
318 .BR dpkg-buildpackage
322 Can be repeated as necessary.
325 Specifies the .changes file which is to be uploaded. By default
326 dgit push looks for single .changes file in the parent directory whose
327 filename suggests it is for the right package and version - or,
328 if there is a _multi.changes file, dgit uses that.
330 .BI --existing-package= package
331 dgit push needs to canonicalise the suite name. But currently
332 there is no way to ask the archive to do this without knowing the
333 name of an existing package. Without --new we can just use the
334 package we are trying to push. But with --new that will not work, so
337 or use the value of this option.
340 Print a usage summary.
346 \fBgit-buildpackage\fP(1),
347 \fBdpkg-buildpackage\fP(1),
349 https://wiki.debian.org/Alioth
351 dgit looks at the following git config keys to control its behaviour.
352 You may set them with git-config (either in system-global or per-tree
353 configuration), or provide
355 on the dgit command line.
357 .BI dgit-suite. suite .distro
359 .BI dgit.default.distro
361 .BI dgit-distro. distro .username
363 .BI dgit-distro. distro .git-url
365 .BI dgit-distro. distro .git-user
367 .BI dgit-distro. distro .git-host
369 .BI dgit-distro. distro .git-proto
371 .BI dgit-distro. distro .git-path
373 .BI dgit-distro. distro .git-check
375 .BI dgit-distro. distro .git-create
377 .BI dgit-distro. distro .upload-host
379 .BI dgit-distro. distro .mirror
381 .BI dgit-distro. distro .archive-query
383 .BI dgit-distro. distro .archive-query-default-component
385 .BI dgit-distro. distro .sshdakls-user
387 .BI dgit-distro. distro .sshdakls-host
389 .BI dgit-distro. distro .sshdakls-dir
391 .BI dgit-distro. distro .ssh
395 .BR dgit-distro. \fIdistro\fR . *
397 We should be using some kind of vhost/vpath setup for the git repos on
398 alioth, so that they can be moved later if and when this turns out to
401 Debian Policy needs to be updated to describe the new Vcs-Dgit-Master
402 field (and to specify that it is an RC bug for that field to refer
403 to an unavailable commit).
405 The method of canonicalising suite names is bizarre. See the
406 .B --existing-package
407 option for one of the implications.
409 dgit push should perhaps do `git push origin', or something similar,
412 Debian does not have a working rmadison server, so to find out what
413 version of a package is in the archive, or to canonicalise suite
414 names, we ssh directly into the ftpmaster server.
416 The mechanism for checking for and creating per-package repos on
417 alioth is a hideous bodge. One consequence is that dgit currently
418 only works for people with push access.
420 Debian Maintainers are currently not able to push, as there is not
421 currently any mechanism for determining and honouring the archive's
422 ideas about access control. Currently only DDs can push.
424 dgit's representation of format `3.0 (quilt)' source packages does not
425 represent the patch stack. Currently the patch series representation
426 cannot round trip through the archive. Ideally dgit would represent a
427 quilty package with an origin commit of some kind followed by the
428 patch stack as a series of commits followed by a pseudo-merge (to make
429 the branch fast-forwarding). This would also mean a new `dgit
430 rebase-prep' command or some such to turn such a fast-forwarding
431 branch back into a rebasing patch stack, and a `force' option to dgit
432 push (perhaps enabled automatically by a note left by rebase-prep)
433 which will make the required pseudo-merge.
435 If the dgit push fails halfway through, it should be restartable and
436 idempotent. However this is not true for the git tag operation.
437 Also, it would be good to check that the proposed signing key is
438 available before starting work.
440 dgit's handling of .orig.tar.gz is not very sophisticated. Ideally
441 the .orig.tar.gz could be transported via the git repo as git tags.
442 Doing this is made more complicated by the possibility of a `3.0
443 (quilt)' package with multiple .orig tarballs.
445 `3.0 (quilt)' packages have an additional difficulty: if these are
446 edited in the most normal way, and then fed to dpkg-buildpackage,
447 dpkg-source will add extra quilt patch metadata to the source tree
448 during the source package build. This extra metadata is then of
449 course not included in the git history. So dgit push needs to commit
450 it for you, to make sure that the git history and archive contents are
451 identical. That this is necessary is a bug in the `3.0 (quilt)'
454 There should be an option which arranges for the `3.0 (quilt)'
455 autocommit to not appear on your HEAD, but instead only in the
456 remote tracking suite branch.
458 There should at the very least be some advice in the manpage about how
459 to use dgit when the signing key is not available on the same machine
462 The option parser requires values to be cuddled to the option name.
464 dgit assumes knowledge of the archive layout. There appears to be no
465 sane way to find the path in the archive pool of the .dsc for a
466 particular suite. I'm assured that the archive layout is a
467 `well known algorithm' by now.
469 --dry-run often does not work with fetch, even though this is a
470 logically plausible request. (It fails, instead.)