chiark / gitweb /
success msgs
[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]
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
16 [\fIgit\-buildpackage\-opts\fP|\fIdpkg\-buildpackage\-opts\fp]
17 .br
18 .B dgit
19 [\fIdgit\-opts\fP] \fBpush\fP [\fIdgit\-opts\fP]
20 [\fIsuite\fP]
21 .SH DESCRIPTION
22 .B dgit
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
28 as
29 .B dgit-repos
30 which lives outside the Debian archive (currently, on Alioth).
31
32 .B dgit clone
33 and
34 .B dgit fetch
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.
40
41 .B dgit build
42 runs
43 .B git-buildpackage
44 with some suitable options.  Options after
45 .B build
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.
50
51 .B 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.
56 .SH WORKFLOW - SIMPLE
57 It is always possible with dgit to clone or fetch a package, make
58 changes in git (using git-commit) on the suite branch
59 .RB ( "git checkout dgit/" \fIsuite\fR)
60 and then dgit push.  You can use whatever gitish techniques you like
61 to construct the commit to push; the only requirement is that it is a
62 descendant of the state of the archive, as provided by dgit in the
63 remote tracking branch
64 .BR remotes/dgit/ \fIsuite\fR.
65
66 If you are lucky the other uploaders have also used dgit and
67 integrated the other relevant git history; if not you can fetch it
68 into your tree and cherry-pick etc. as you wish.
69 .SH WORKFLOW - INTEGRATING BETWEEN DGIT AND OTHER GIT HISTORY
70 If you are the maintainer of a package dealing with uploads made
71 without dgit, you will probably want to merge the synthetic commits
72 (made by dgit to represent the uploads) into your git history.
73 Normally you can just merge the dgit branch into your own master, or
74 indeed if you do your work on the dgit local suite branch
75 .BI dgit/ suite
76 you can just use dgit pull.
77
78 However the first time dgit is used it will generate a new origin
79 commit from the archive which won't be linked into the rest of your
80 git history.  You will need to merge this.
81
82 If last upload was in fact made with git, you should usually proceed
83 as follows: identify the commit which was actually used to build the
84 package.  (Hopefully you have a tag for this.)  Check out the dgit
85 branch
86 .RB ( "git checkout dgit/" \fIsuite\fR)
87 and merge that other commit
88 .RB ( "git merge debian/" \fIversion\fR).
89 Hopefully this merge will be trivial because the two trees should
90 be the same.  The resulting branch head can be merged into your
91 working branches
92 .RB ( "git checkout master && git merge dgit/" \fIsuite\fR).
93
94 If last upload was not made with git, a different approach is required
95 to start using dgit.  First, do
96 .B dgit fetch
97 (or clone) obtain a git history representation of what's in the
98 archive and record it in the
99 .BI remotes/dgit/ suite
100 tracking branch.  Then construct somehow, using your other git history
101 plus appropriate diffs and cherry picks from the dgit remote tracking
102 branch, a git commit whose tree corresponds to the tree to use for the
103 next upload.  If that commit-to-be-uploaded is not a descendant of the
104 dig remote tracking branch, check it out and say
105 .BR "git merge -s ours remotes/dgit/" \fIsuite\fR;
106 that tells git that we are deliberately throwing away any differences
107 between what's in the archive and what you intend to upload.
108 Then run
109 .BR "dgit push"
110 to actually upload the result.
111 .SH MODEL
112 You may use any suitable git workflow with dgit, provided you
113 satisfy dgit's requirements:
114
115 dgit maintains a pseudo-remote called
116 .BR dgit ,
117 with one branch per suite.  This remote cannot be used with
118 plain git.
119
120 The
121 .B dgit-repos
122 repository for each package contains one ref per suite named
123 \fBrefs/dgit/\fR\fIsuite\fR.  These should be pushed to only by
124 dgit.  They are fast forwarding.  Each push on this branch
125 corresponds to an upload (or attempted upload).
126
127 However, it is perfectly fine to have other branches in dgit-repos;
128 normally the dgit-repos repo for the package will be accessible via
129 the remote name `origin'.
130
131 dgit push can operate on any commit which is a descendant of the
132 current dgit/suite tip in dgit-repos.
133
134 Uploads made by dgit contain an additional field
135 .B Vcs-Dgit-Master
136 in the source package .dsc.  (This is added by dgit push.)
137 This specifies a commit (an ancestor of the dgit/suite
138 branch) whose tree is identical to the unpacked source upload.
139
140 Uploads not made by dgit are represented in git by commits which are
141 synthesised by dgit.  The tree of each such commit corresponds to the
142 unpacked source; there is an origin commit with the contents, and a
143 psuedo-merge from last known upload - that is, from the contents of
144 the dgit/suite branch.
145
146 dgit expects repos that it works with to have a
147 .B dgit
148 remote.  This refers to the well-known dgit-repos location
149 (currently, the dgit-repos project on Alioth).  dgit fetch updates
150 the remote tracking branch for dgit/suite.
151
152 dgit does not (currently) represent the orig tarball(s) in git; nor
153 does it represent the patch statck of a `3.0 (quilt)' package.  The
154 orig tarballs are downloaded and kept in the parent directory, as with
155 a traditional (non-gitish) dpkg-source workflow.
156
157 To a user looking at the archive, changes pushed using dgit look like
158 changes made in an NMU: in a `3.0 (quilt)' package the delta from the
159 previous upload is recorded in a new patch constructed by dpkg-source.
160 .SH PACKAGE SOURCE FORMATS
161 If you are not the maintainer, you do not need to worry about the
162 source format of the package.  You can just make changes as you like
163 in git.  If the package is a `3.0 (quilt)' package, the patch stack
164 will usually not be represented in the git history.
165
166 If you are the maintainer of a non-native package, you currently have
167 two sensible options:
168
169 Firstly, you can regard your git history as primary, and the archive
170 as an export format.  For example, you could maintain topic branches
171 in git and a fast-forwarding release branch; or you could do your work
172 directly in a merging way on the
173 .BI dgit/ suite
174 branches.  If you do this you should probably use a `1.0' format
175 source package.  In the archive, the delta between upstream will be
176 represented in the single Debian patch.
177
178 Secondly, you can regard your quiltish patch stack in the archive as
179 primary.  You will have to use other tools besides dgit to import and
180 export this patch stack.  See also the BUGS section.
181 .SH OPTIONS
182 .TP
183 .BR --dry-run | -n
184 Go through the motions, fetching all information needed, but do not
185 actually update the output(s).  For push, dgit does
186 the required checks and leaves the new .dsc in a temporary file,
187 but does not sign, tag, push or upload.
188 .TP
189 .BI -k keyid
190 Use
191 .I keyid
192 for signing the tag and the upload.
193 .TP
194 .BR --no-sign
195 does not sign tags or uploads (meaningful only with push).
196 .TP
197 .TP
198 .BI -p package
199 Specifies that we should process source package
200 .I package
201 rather than looking in debian/control or debian/changelog.
202 Valid with dgit fetch and dgit pull, only.
203 .TP
204 .BR -N | --new
205 The package may be new in this suite.  Without this, dgit will
206 refuse to push.
207 .TP
208 .BI -D
209 Prints debugging information to stderr.  Repeating the option produces
210 more output (currently, up to -DD is meaningfully different).
211 .TP
212 .BI -c name = value
213 Specifies a git configuration option.  dgit itself is also controlled
214 by git configuration options.
215 .TP
216 .RI \fB--dget=\fR program |\fB--dput=\fR program |\fB--debsign=\fR program
217 Specifies alternative programs to use instead of dget, dput
218 or debsign.
219 .TP
220 .RI \fB--dget:\fR option |\fB--dput:\fR option |\fB--debsign:\fR option
221 Specifies a single additional option to pass to dget, dput or
222 debsign.  Use repeatedly if multiple additional options are required.
223 .TP
224 .BI -C changesfile
225 Specifies the .changes file which is to be uploaded.  By default
226 dgit push looks for single .changes file in the parent directory whose
227 filename suggests it is for the right package and version.
228 .TP
229 .BI --existing-package= package
230 dgit push needs to canonicalise the suite name.  But currently
231 there is no way to ask the archive to do this without knowing the
232 name of an existing package.  Without --new we can just use the
233 package we are trying to push.  But with --new that will not work, so
234 we guess that
235 .B dpkg
236 exists in the target suite.  If it doesn't, you can use this option to
237 specify a package which does.  If the suite is empty, bad luck.
238 .SH CONFIGURATION
239 dgit looks at the following git config keys to control its behaviour.
240 You may set them with git-config (either in system-global or per-tree
241 configuration), or provide
242 .BI -c key = value
243 on the dgit command line.
244 .TP
245 .BI dgit-suite. suite .distro
246 .TP
247 .BI dgit.default.distro
248 .TP
249 .BI dgit.default.username
250 .TP
251 .BI dgit-distro. distro .git-url
252 .TP
253 .BI dgit-distro. distro .git-host
254 .TP
255 .BI dgit-distro. distro .git-proto
256 .TP
257 .BI dgit-distro. distro .git-path
258 .TP
259 .BI dgit-distro. distro .git-check
260 .TP
261 .BI dgit-distro. distro .git-create
262 .TP
263 .BI dgit-distro. distro .upload-host
264 .TP
265 .BI dgit-distro. distro .mirror
266 .TP
267 .BI dgit-distro. distro .archive-query
268 .TP
269 .BI dgit-distro. distro .archive-query-default-component
270 .TP
271 .BI dgit-distro. distro .ssh
272 .TP
273 .BR dgit.default. *
274 for each
275 .BR dgit-distro. \fIdistro\fR . *
276 .SH BUGS
277 We should be using some kind of vhost/vpath setup for the git repos on
278 alioth, so that they can be moved later if and when this turns out to
279 be a good idea.
280
281 Debian Policy needs to be updated to describe the new Vcs-Dgit-Master
282 field (and to specify that it is an RC bug for that field to refer
283 to an unavailable commit).
284
285 The method of canonicalising suite names is bizarre.  See the
286 .B --existing-package
287 option for one of the implication.s
288
289 dgit push should perhaps do `git push origin', or something similar,
290 by default.
291
292 The mechanism for checking for and creating per-package repos on
293 alioth is a hideous bodge.  One consequence is that dgit currently
294 only works for people with push access.
295
296 Debian Maintainers are currently not able to push, as there is not
297 currently any mechanism for determining and honouring the archive's
298 ideas about access control.  Currently only DDs can push.
299
300 dgit's representation of format `3.0 (quilt)' source packages does not
301 represent the patch stack.  Currently the patch series representation
302 cannot round trip through the archive.  Ideally dgit would represent a
303 quilty package with an origin commit of some kind followed by the
304 patch stack as a series of commits followed by a pseudo-merge (to make
305 the branch fast-forwarding).  This would also mean a new `dgit
306 rebase-prep' command or some such to turn such a fast-forwarding
307 branch back into a rebasing patch stack, and a `force' option to dgit
308 push (perhaps enabled automatically by a note left by rebase-prep)
309 which will make the required pseudo-merge.
310
311 If the dgit push fails halfway through, it should be restartable and
312 idempotent.  However this is not true for the git tag operation.
313 Also, it would be good to check that the proposed signing key is
314 available before starting work.
315
316 dgit's handling of .orig.tar.gz is not very sophisticated.  Ideally
317 the .orig.tar.gz could be transported via the git repo as git tags.
318 Doing this is made more complicated by the possibility of a `3.0
319 (quilt)' package with multiple .orig tarballs.
320
321 The error messages are often unhelpfully terse and tend to refer to
322 line numbers in dgit.
323
324 The option parser requires values to be cuddled to the option name.
325
326 dgit assumes knowledge of the archive layout.  There appears to be no
327 sane way to find the path in the archive pool of the .dsc for a
328 particular suite.  I'm assured that the archive layout is a
329 `well known algorithm' by now.
330
331 --dry-run often does not work with fetch, even though this is a
332 logically plausible request.  (It fails, instead.)