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
16 [\fIgit\-buildpackage\-opts\fP|\fIdpkg\-buildpackage\-opts\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).
36 \fBdgit clone\fR \fIpackage\fP [\fIsuite\fP] [\fB./\fP\fIdir|\fB/\fP\fIdir]
37 Consults the archive and dgit-repos to construct the git view of
44 in a new directory (named
47 also, downloads any necessary orig tarballs.
49 The suite's git tip is
50 left on the local branch
52 ready for work, and on the corresponding dgit remote tracking branch.
55 remote will be set up to point to the package's dgit-repos tree
56 for the distro to which
60 \fBdgit fetch\fR [\fIsuite\fP]
61 Consults the archive and git-repos to update the git view of
62 history for a specific suite (and downloads any necessary orig
63 tarballs), and updates the remote tracking branch
64 .BR remotes/dgit/ \fIsuite\fR.
65 If the current branch is
67 then dgit fetch defaults to
69 otherwise it parses debian/changelog and uses the suite specified
72 \fBdgit pull\fR [\fIsuite\fP]
73 Does dgit fetch, and then merges the new head of the remote tracking
75 .BI remotes/dgit/ suite
76 into the current branch.
81 with some suitable options. Options and argumments after
83 will be passed on to git-buildpackage. It is not necessary to use
84 dgit build when using dgit; it is OK to use any approach which ensures
85 that the generated source package corresponds to the relevant git
86 commit. Tagging and signing should be left to dgit push.
89 Does an `upload', pushing the current HEAD to the archive (as a source
90 package) and to dgit-repos (as git commits). The package must already
91 have been built ready for upload, with the .dsc and .changes
92 left in the parent directory.
94 In more detail: dgit push checks that the current HEAD corresponds to
95 the .dsc. It then pushes the HEAD to the suite's dgit-repos branch,
96 makes a signed git tag, edits the .dsc to contain the dgit metadata
97 field, runs debsign to sign the upload (.dsc and .changes), pushes the
98 signed tag, and finally uses dput to upload the .changes to the
101 For a format `3.0 (quilt)' source package, dgit push
102 may also have to make a commit on your current branch to contain
103 quilt metadata. It will do this automatically if necessary.
104 You can explicitly request that dgit do just this
107 dgit push always uses the package, suite and version specified in the
108 debian/changelog and the .dsc, which must agree.
111 Looks to see if there is quilt patch metadata left over by dpkg-source
112 -b, and if so makes a git commit of it. This is normally done
113 automatically by dgit push. dgit quilt-fixup takes no additional
114 arguments. Note that it will only process a patch generated by
115 dpkg-source for the most recent version (according to the
118 It is not normally necessary to run dgit quilt-fixup explicitly;
119 where necessary it is done as part of dgit push.
120 .SH WORKFLOW - SIMPLE
121 It is always possible with dgit to clone or fetch a package, make
122 changes in git (using git-commit) on the suite branch
123 .RB ( "git checkout dgit/" \fIsuite\fR)
124 and then dgit push. You can use whatever gitish techniques you like
125 to construct the commit to push; the only requirement is that it is a
126 descendant of the state of the archive, as provided by dgit in the
127 remote tracking branch
128 .BR remotes/dgit/ \fIsuite\fR.
130 If you are lucky the other uploaders have also used dgit and
131 integrated the other relevant git history; if not you can fetch it
132 into your tree and cherry-pick etc. as you wish.
133 .SH WORKFLOW - INTEGRATING BETWEEN DGIT AND OTHER GIT HISTORY
134 If you are the maintainer of a package dealing with uploads made
135 without dgit, you will probably want to merge the synthetic commits
136 (made by dgit to represent the uploads) into your git history.
137 Normally you can just merge the dgit branch into your own master, or
138 indeed if you do your work on the dgit local suite branch
140 you can just use dgit pull.
142 However the first time dgit is used it will generate a new origin
143 commit from the archive which won't be linked into the rest of your
144 git history. You will need to merge this.
146 If last upload was in fact made with git, you should usually proceed
147 as follows: identify the commit which was actually used to build the
148 package. (Hopefully you have a tag for this.) Check out the dgit
150 .RB ( "git checkout dgit/" \fIsuite\fR)
151 and merge that other commit
152 .RB ( "git merge debian/" \fIversion\fR).
153 Hopefully this merge will be trivial because the two trees should
154 be the same. The resulting branch head can be merged into your
156 .RB ( "git checkout master && git merge dgit/" \fIsuite\fR).
158 If last upload was not made with git, a different approach is required
159 to start using dgit. First, do
161 (or clone) to obtain a git history representation of what's in the
162 archive and record it in the
163 .BI remotes/dgit/ suite
164 tracking branch. Then somehow, using your other git history
165 plus appropriate diffs and cherry picks from the dgit remote tracking
166 branch, construct a git commit whose tree corresponds to the tree to use for the
167 next upload. If that commit-to-be-uploaded is not a descendant of the
168 dig remote tracking branch, check it out and say
169 .BR "git merge -s ours remotes/dgit/" \fIsuite\fR;
170 that tells git that we are deliberately throwing away any differences
171 between what's in the archive and what you intend to upload.
174 to actually upload the result.
176 You may use any suitable git workflow with dgit, provided you
177 satisfy dgit's requirements:
179 dgit maintains a pseudo-remote called
181 with one branch per suite. This remote cannot be used with
186 repository for each package contains one ref per suite named
187 \fBrefs/dgit/\fR\fIsuite\fR. These should be pushed to only by
188 dgit. They are fast forwarding. Each push on this branch
189 corresponds to an upload (or attempted upload).
191 However, it is perfectly fine to have other branches in dgit-repos;
192 normally the dgit-repos repo for the package will be accessible via
193 the remote name `origin'.
195 dgit push will also (by default) make signed tags called
197 and push them to dgit-repos, but nothing depends on these tags
200 dgit push can operate on any commit which is a descendant of the
201 current dgit/suite tip in dgit-repos.
203 Uploads made by dgit contain an additional field
205 in the source package .dsc. (This is added by dgit push.)
206 This specifies a commit (an ancestor of the dgit/suite
207 branch) whose tree is identical to the unpacked source upload.
209 Uploads not made by dgit are represented in git by commits which are
210 synthesised by dgit. The tree of each such commit corresponds to the
211 unpacked source; there is an origin commit with the contents, and a
212 psuedo-merge from last known upload - that is, from the contents of
213 the dgit/suite branch.
215 dgit expects repos that it works with to have a
217 remote. This refers to the well-known dgit-repos location
218 (currently, the dgit-repos project on Alioth). dgit fetch updates
219 the remote tracking branch for dgit/suite.
221 dgit does not (currently) represent the orig tarball(s) in git; nor
222 does it represent the patch statck of a `3.0 (quilt)' package. The
223 orig tarballs are downloaded and kept in the parent directory, as with
224 a traditional (non-gitish) dpkg-source workflow.
226 To a user looking at the archive, changes pushed using dgit look like
227 changes made in an NMU: in a `3.0 (quilt)' package the delta from the
228 previous upload is recorded in a new patch constructed by dpkg-source.
229 .SH PACKAGE SOURCE FORMATS
230 If you are not the maintainer, you do not need to worry about the
231 source format of the package. You can just make changes as you like
232 in git. If the package is a `3.0 (quilt)' package, the patch stack
233 will usually not be represented in the git history.
235 If you are the maintainer of a non-native package, you currently have
236 two sensible options:
238 Firstly, you can regard your git history as primary, and the archive
239 as an export format. For example, you could maintain topic branches
240 in git and a fast-forwarding release branch; or you could do your work
241 directly in a merging way on the
243 branches. If you do this you should probably use a `1.0' format
244 source package. In the archive, the delta between upstream will be
245 represented in the single Debian patch.
247 Secondly, you can regard your quiltish patch stack in the archive as
248 primary. You will have to use other tools besides dgit to import and
249 export this patch stack. For `3.0 (quilt)' packages, dgit has to do
250 more work to work around some braindamage in way dpkg-source handles
251 changes made to this format. See also the BUGS section. We recommend
252 against the use of `3.0 (quilt)'.
256 Go through the motions, fetching all information needed, but do not
257 actually update the output(s). For push, dgit does
258 the required checks and leaves the new .dsc in a temporary file,
259 but does not sign, tag, push or upload.
264 for signing the tag and the upload.
267 does not sign tags or uploads (meaningful only with push).
271 Specifies that we should process source package
273 rather than looking in debian/control or debian/changelog.
274 Valid with dgit fetch and dgit pull, only.
277 The package may be new in this suite. Without this, dgit will
281 Prints debugging information to stderr. Repeating the option produces
282 more output (currently, up to -DD is meaningfully different).
285 Specifies a git configuration option. dgit itself is also controlled
286 by git configuration options.
288 .RI \fB--dget=\fR program |\fB--dput=\fR program |\fB--debsign=\fR program
289 Specifies alternative programs to use instead of dget, dput
292 .RI \fB--dget:\fR option |\fB--dput:\fR option |\fB--debsign:\fR option
293 Specifies a single additional option to pass to dget, dput or
294 debsign. Use repeatedly if multiple additional options are required.
297 Specifies the .changes file which is to be uploaded. By default
298 dgit push looks for single .changes file in the parent directory whose
299 filename suggests it is for the right package and version.
301 .BI --existing-package= package
302 dgit push needs to canonicalise the suite name. But currently
303 there is no way to ask the archive to do this without knowing the
304 name of an existing package. Without --new we can just use the
305 package we are trying to push. But with --new that will not work, so
308 or use the value of this option.
311 Print a usage summary.
317 \fBgit-buildpackage\fP(1),
318 \fBdpkg-buildpackage\fP(1),
320 https://wiki.debian.org/Alioth
322 dgit looks at the following git config keys to control its behaviour.
323 You may set them with git-config (either in system-global or per-tree
324 configuration), or provide
326 on the dgit command line.
328 .BI dgit-suite. suite .distro
330 .BI dgit.default.distro
332 .BI dgit-distro. distro .username
334 .BI dgit-distro. distro .git-url
336 .BI dgit-distro. distro .git-user
338 .BI dgit-distro. distro .git-host
340 .BI dgit-distro. distro .git-proto
342 .BI dgit-distro. distro .git-path
344 .BI dgit-distro. distro .git-check
346 .BI dgit-distro. distro .git-create
348 .BI dgit-distro. distro .upload-host
350 .BI dgit-distro. distro .mirror
352 .BI dgit-distro. distro .archive-query
354 .BI dgit-distro. distro .archive-query-default-component
356 .BI dgit-distro. distro .sshdakls-user
358 .BI dgit-distro. distro .sshdakls-host
360 .BI dgit-distro. distro .sshdakls-dir
362 .BI dgit-distro. distro .ssh
366 .BR dgit-distro. \fIdistro\fR . *
368 We should be using some kind of vhost/vpath setup for the git repos on
369 alioth, so that they can be moved later if and when this turns out to
372 Debian Policy needs to be updated to describe the new Vcs-Dgit-Master
373 field (and to specify that it is an RC bug for that field to refer
374 to an unavailable commit).
376 The method of canonicalising suite names is bizarre. See the
377 .B --existing-package
378 option for one of the implications.
380 dgit push should perhaps do `git push origin', or something similar,
383 Debian does not have a working rmadison server, so to find out what
384 version of a package is in the archive, or to canonicalise suite
385 names, we ssh directly into the ftpmaster server.
387 The mechanism for checking for and creating per-package repos on
388 alioth is a hideous bodge. One consequence is that dgit currently
389 only works for people with push access.
391 Debian Maintainers are currently not able to push, as there is not
392 currently any mechanism for determining and honouring the archive's
393 ideas about access control. Currently only DDs can push.
395 dgit's representation of format `3.0 (quilt)' source packages does not
396 represent the patch stack. Currently the patch series representation
397 cannot round trip through the archive. Ideally dgit would represent a
398 quilty package with an origin commit of some kind followed by the
399 patch stack as a series of commits followed by a pseudo-merge (to make
400 the branch fast-forwarding). This would also mean a new `dgit
401 rebase-prep' command or some such to turn such a fast-forwarding
402 branch back into a rebasing patch stack, and a `force' option to dgit
403 push (perhaps enabled automatically by a note left by rebase-prep)
404 which will make the required pseudo-merge.
406 If the dgit push fails halfway through, it should be restartable and
407 idempotent. However this is not true for the git tag operation.
408 Also, it would be good to check that the proposed signing key is
409 available before starting work.
411 dgit's handling of .orig.tar.gz is not very sophisticated. Ideally
412 the .orig.tar.gz could be transported via the git repo as git tags.
413 Doing this is made more complicated by the possibility of a `3.0
414 (quilt)' package with multiple .orig tarballs.
416 `3.0 (quilt)' packages have an additional difficulty: if these are
417 edited in the most normal way, and then fed to dpkg-buildpackage,
418 dpkg-source will add extra quilt patch metadata to the source tree
419 during the source package build. This extra metadata is then of
420 course not included in the git history. So dgit push needs to commit
421 it for you, to make sure that the git history and archive contents are
422 identical. That this is necessary is a bug in the `3.0 (quilt)'
425 There should be an option which arranges for the `3.0 (quilt)'
426 autocommit to not appear on your HEAD, but instead only in the
427 remote tracking suite branch.
429 There should at the very least be some advice in the manpage about how
430 to use dgit when the signing key is not available on the same machine
433 The option parser requires values to be cuddled to the option name.
435 dgit assumes knowledge of the archive layout. There appears to be no
436 sane way to find the path in the archive pool of the .dsc for a
437 particular suite. I'm assured that the archive layout is a
438 `well known algorithm' by now.
440 --dry-run often does not work with fetch, even though this is a
441 logically plausible request. (It fails, instead.)