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 treats the Debian archive as a version control system, and
24 bidirectionally gateways between the archive and git. The git view of
25 the package can contain the usual upstream git history, and will be
26 augmented by commits representing uploads done by other developers not
27 using dgit. This git history is stored in a canonical location known
30 which lives outside the Debian archive (currently, on Alioth).
35 consult the archive and dgit-repos and fetch and/or construct the
36 git view of the history. With clone, the destination directory (by
37 default, the package name in the current directory) will be created,
38 and the new directory's `origin' remote will be set up to point to
39 the package's dgit-repos tree.
44 with some suitable options. Options after
46 will be passed on to git-buildpackage. It is not necessary to
47 use dgit build; it is OK to use any approach which ensures that
48 the generated source package corresponds to the relevant git commit.
49 Tagging and signing should be left to dgit push.
52 does an `upload', pushing the current HEAD to the archive (as a source
53 package) and to dgit-repos (as git commits). This also involves
54 making a signed git tag, and signing the files to be uploaded to the
55 archive. (For a format `3.0 (quilt)' source package, dgit push
56 may also have to make a commit on your current branch to contain
57 quilt metadata. It will do this automatically.)
60 looks to see if there is quilt patch metadata left over by dpkg-source
61 -b, and if so makes a git commit of it. This is normally done
62 automatically by dgit push. dgit quilt-fixup takes no additional
63 arguments. Note that it will only process a patch generated by
64 dpkg-source for the most recent version (according to the
67 It is always possible with dgit to clone or fetch a package, make
68 changes in git (using git-commit) on the suite branch
69 .RB ( "git checkout dgit/" \fIsuite\fR)
70 and then dgit push. You can use whatever gitish techniques you like
71 to construct the commit to push; the only requirement is that it is a
72 descendant of the state of the archive, as provided by dgit in the
73 remote tracking branch
74 .BR remotes/dgit/ \fIsuite\fR.
76 If you are lucky the other uploaders have also used dgit and
77 integrated the other relevant git history; if not you can fetch it
78 into your tree and cherry-pick etc. as you wish.
79 .SH WORKFLOW - INTEGRATING BETWEEN DGIT AND OTHER GIT HISTORY
80 If you are the maintainer of a package dealing with uploads made
81 without dgit, you will probably want to merge the synthetic commits
82 (made by dgit to represent the uploads) into your git history.
83 Normally you can just merge the dgit branch into your own master, or
84 indeed if you do your work on the dgit local suite branch
86 you can just use dgit pull.
88 However the first time dgit is used it will generate a new origin
89 commit from the archive which won't be linked into the rest of your
90 git history. You will need to merge this.
92 If last upload was in fact made with git, you should usually proceed
93 as follows: identify the commit which was actually used to build the
94 package. (Hopefully you have a tag for this.) Check out the dgit
96 .RB ( "git checkout dgit/" \fIsuite\fR)
97 and merge that other commit
98 .RB ( "git merge debian/" \fIversion\fR).
99 Hopefully this merge will be trivial because the two trees should
100 be the same. The resulting branch head can be merged into your
102 .RB ( "git checkout master && git merge dgit/" \fIsuite\fR).
104 If last upload was not made with git, a different approach is required
105 to start using dgit. First, do
107 (or clone) obtain a git history representation of what's in the
108 archive and record it in the
109 .BI remotes/dgit/ suite
110 tracking branch. Then construct somehow, using your other git history
111 plus appropriate diffs and cherry picks from the dgit remote tracking
112 branch, a git commit whose tree corresponds to the tree to use for the
113 next upload. If that commit-to-be-uploaded is not a descendant of the
114 dig remote tracking branch, check it out and say
115 .BR "git merge -s ours remotes/dgit/" \fIsuite\fR;
116 that tells git that we are deliberately throwing away any differences
117 between what's in the archive and what you intend to upload.
120 to actually upload the result.
122 You may use any suitable git workflow with dgit, provided you
123 satisfy dgit's requirements:
125 dgit maintains a pseudo-remote called
127 with one branch per suite. This remote cannot be used with
132 repository for each package contains one ref per suite named
133 \fBrefs/dgit/\fR\fIsuite\fR. These should be pushed to only by
134 dgit. They are fast forwarding. Each push on this branch
135 corresponds to an upload (or attempted upload).
137 However, it is perfectly fine to have other branches in dgit-repos;
138 normally the dgit-repos repo for the package will be accessible via
139 the remote name `origin'.
141 dgit push can operate on any commit which is a descendant of the
142 current dgit/suite tip in dgit-repos.
144 Uploads made by dgit contain an additional field
146 in the source package .dsc. (This is added by dgit push.)
147 This specifies a commit (an ancestor of the dgit/suite
148 branch) whose tree is identical to the unpacked source upload.
150 Uploads not made by dgit are represented in git by commits which are
151 synthesised by dgit. The tree of each such commit corresponds to the
152 unpacked source; there is an origin commit with the contents, and a
153 psuedo-merge from last known upload - that is, from the contents of
154 the dgit/suite branch.
156 dgit expects repos that it works with to have a
158 remote. This refers to the well-known dgit-repos location
159 (currently, the dgit-repos project on Alioth). dgit fetch updates
160 the remote tracking branch for dgit/suite.
162 dgit does not (currently) represent the orig tarball(s) in git; nor
163 does it represent the patch statck of a `3.0 (quilt)' package. The
164 orig tarballs are downloaded and kept in the parent directory, as with
165 a traditional (non-gitish) dpkg-source workflow.
167 To a user looking at the archive, changes pushed using dgit look like
168 changes made in an NMU: in a `3.0 (quilt)' package the delta from the
169 previous upload is recorded in a new patch constructed by dpkg-source.
170 .SH PACKAGE SOURCE FORMATS
171 If you are not the maintainer, you do not need to worry about the
172 source format of the package. You can just make changes as you like
173 in git. If the package is a `3.0 (quilt)' package, the patch stack
174 will usually not be represented in the git history.
176 If you are the maintainer of a non-native package, you currently have
177 two sensible options:
179 Firstly, you can regard your git history as primary, and the archive
180 as an export format. For example, you could maintain topic branches
181 in git and a fast-forwarding release branch; or you could do your work
182 directly in a merging way on the
184 branches. If you do this you should probably use a `1.0' format
185 source package. In the archive, the delta between upstream will be
186 represented in the single Debian patch.
188 Secondly, you can regard your quiltish patch stack in the archive as
189 primary. You will have to use other tools besides dgit to import and
190 export this patch stack. For `3.0 (quilt)' packages, dgit has to do
191 more work to work around quilt braindamage. See also the BUGS
192 section. We recommend against the use of `3.0 (quilt)'.
196 Go through the motions, fetching all information needed, but do not
197 actually update the output(s). For push, dgit does
198 the required checks and leaves the new .dsc in a temporary file,
199 but does not sign, tag, push or upload.
204 for signing the tag and the upload.
207 does not sign tags or uploads (meaningful only with push).
211 Specifies that we should process source package
213 rather than looking in debian/control or debian/changelog.
214 Valid with dgit fetch and dgit pull, only.
217 The package may be new in this suite. Without this, dgit will
221 Prints debugging information to stderr. Repeating the option produces
222 more output (currently, up to -DD is meaningfully different).
225 Specifies a git configuration option. dgit itself is also controlled
226 by git configuration options.
228 .RI \fB--dget=\fR program |\fB--dput=\fR program |\fB--debsign=\fR program
229 Specifies alternative programs to use instead of dget, dput
232 .RI \fB--dget:\fR option |\fB--dput:\fR option |\fB--debsign:\fR option
233 Specifies a single additional option to pass to dget, dput or
234 debsign. Use repeatedly if multiple additional options are required.
237 Specifies the .changes file which is to be uploaded. By default
238 dgit push looks for single .changes file in the parent directory whose
239 filename suggests it is for the right package and version.
241 .BI --existing-package= package
242 dgit push needs to canonicalise the suite name. But currently
243 there is no way to ask the archive to do this without knowing the
244 name of an existing package. Without --new we can just use the
245 package we are trying to push. But with --new that will not work, so
248 dgit looks at the following git config keys to control its behaviour.
249 You may set them with git-config (either in system-global or per-tree
250 configuration), or provide
252 on the dgit command line.
254 .BI dgit-suite. suite .distro
256 .BI dgit.default.distro
258 .BI dgit-distro. distro .username
260 .BI dgit-distro. distro .git-url
262 .BI dgit-distro. distro .git-user
264 .BI dgit-distro. distro .git-host
266 .BI dgit-distro. distro .git-proto
268 .BI dgit-distro. distro .git-path
270 .BI dgit-distro. distro .git-check
272 .BI dgit-distro. distro .git-create
274 .BI dgit-distro. distro .upload-host
276 .BI dgit-distro. distro .mirror
278 .BI dgit-distro. distro .archive-query
280 .BI dgit-distro. distro .archive-query-default-component
282 .BI dgit-distro. distro .sshdakls-user
284 .BI dgit-distro. distro .sshdakls-host
286 .BI dgit-distro. distro .sshdakls-dir
288 .BI dgit-distro. distro .ssh
292 .BR dgit-distro. \fIdistro\fR . *
294 We should be using some kind of vhost/vpath setup for the git repos on
295 alioth, so that they can be moved later if and when this turns out to
298 Debian Policy needs to be updated to describe the new Vcs-Dgit-Master
299 field (and to specify that it is an RC bug for that field to refer
300 to an unavailable commit).
302 The method of canonicalising suite names is bizarre. See the
303 .B --existing-package
304 option for one of the implications.
306 dgit push should perhaps do `git push origin', or something similar,
309 Debian does not have a working rmadison server, so to find out what
310 version of a package is in the archive, or to canonicalise suite
311 names, we ssh directly into the ftpmaster server.
313 The mechanism for checking for and creating per-package repos on
314 alioth is a hideous bodge. One consequence is that dgit currently
315 only works for people with push access.
317 Debian Maintainers are currently not able to push, as there is not
318 currently any mechanism for determining and honouring the archive's
319 ideas about access control. Currently only DDs can push.
321 dgit's representation of format `3.0 (quilt)' source packages does not
322 represent the patch stack. Currently the patch series representation
323 cannot round trip through the archive. Ideally dgit would represent a
324 quilty package with an origin commit of some kind followed by the
325 patch stack as a series of commits followed by a pseudo-merge (to make
326 the branch fast-forwarding). This would also mean a new `dgit
327 rebase-prep' command or some such to turn such a fast-forwarding
328 branch back into a rebasing patch stack, and a `force' option to dgit
329 push (perhaps enabled automatically by a note left by rebase-prep)
330 which will make the required pseudo-merge.
332 If the dgit push fails halfway through, it should be restartable and
333 idempotent. However this is not true for the git tag operation.
334 Also, it would be good to check that the proposed signing key is
335 available before starting work.
337 dgit's handling of .orig.tar.gz is not very sophisticated. Ideally
338 the .orig.tar.gz could be transported via the git repo as git tags.
339 Doing this is made more complicated by the possibility of a `3.0
340 (quilt)' package with multiple .orig tarballs.
342 `3.0 (quilt)' packages have an additional difficulty: if these are
343 edited in the most normal way, and then fed to dpkg-buildpackage,
344 dpkg-source will add extra quilt patch metadata to the source tree
345 during the source package build. This extra metadata is then of
346 course not included in the git history. So dgit push needs to commit
347 it for you, to make sure that the git history and archive contents are
348 identical. That this is necessary is a bug in the `3.0 (quilt)'
351 The error messages are often unhelpfully terse and tend to refer to
352 line numbers in dgit.
354 The option parser requires values to be cuddled to the option name.
356 dgit assumes knowledge of the archive layout. There appears to be no
357 sane way to find the path in the archive pool of the .dsc for a
358 particular suite. I'm assured that the archive layout is a
359 `well known algorithm' by now.
361 --dry-run often does not work with fetch, even though this is a
362 logically plausible request. (It fails, instead.)