chiark / gitweb /
better docs
[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 MODEL AND WORKFLOW
57 You may use any suitable git workflow with dgit, provided you
58 satisfy dgit's requirements:
59
60 dgit maintains what looks a bit like a remote called
61 .BR dgit ,
62 with one branch per suite.  This remote cannot be used with
63 plain git.
64
65 The
66 .B dgit-repos
67 repository for each package contains one ref per suite named
68 \fBrefs/dgit/\fR\fIsuite\fR.  These should be pushed to only by
69 dgit.  They are fast forwarding.  Each push on this branch
70 corresponds to an upload (or attempted upload).
71
72 However, it is perfectly fine to have other branches in dgit-repos;
73 normally the dgit-repos repo for the package will be accessible via
74 the remote name `origin'.
75
76 dgit push can operate on any commit which is a descendant of the
77 current dgit/suite tip in dgit-repos.
78
79 Uploads made by dgit contain an additional field
80 .B Vcs-Git-Master
81 in the source package .dsc.  (This is added by dgit push.)
82 This specifies a commit (an ancestor of the dgit/suite
83 branch) whose tree is identical to the unpacked source upload.
84
85 Uploads not made by dgit are represented in git by commits which are
86 synthesised by dgit.  The tree of each such commit corresponds to the
87 unpacked source; the single parent is the last known upload - that is,
88 the contents of the dgit/suite branch.
89
90 dgit expects repos that it works with to have a
91 .B dgit
92 remote.  This refers to the well-known dgit-repos location
93 (currently, the dgit-repos project on Alioth).  dgit fetch updates
94 the remote tracking branch for dgit/suite.
95 .SH OPTIONS
96 .TP
97 .BR --dry-run | -n
98 Go through the motions, fetching all information needed, but do not
99 actually update the output(s).  For push, dgit does
100 the required checks and leaves the new .dsc in a temporary file,
101 but does not sign, tag, push or upload.
102 .TP
103 .BI -k keyid
104 Use
105 .I keyid
106 for signing the tag and the upload.
107 .TP
108 .BR --no-sign
109 does not sign tags or uploads (meaningful only with push).
110 .TP
111 .TP
112 .BI -p package
113 Specifies that we should process source package
114 .I package
115 rather than looking in debian/control.  Valid with dgit fetch
116 and dgit pull, only.
117 .TP
118 .BI -D
119 Spew debugging information to stderr.
120 .TP
121 .BI -c name = value
122 Specifies a git configuration option.  dgit itself is also controlled
123 by git configuration options.
124 .TP
125 .RI \fB--dget=\fR program |\fB--dput=\fR program |\fB--debsign=\fR program
126 Specifies alternative programs to use instead of dget, dput
127 or debsign.
128 .TP
129 .RI \fB--dget:\fR option |\fB--dput:\fR option |\fB--debsign:\fR option
130 Specifies a single additional option to pass to dget, dput or
131 debsign.  Use repeatedly if multiple additional options are required.
132 .TP
133 .BI -C changesfile
134 Specifies the .changes file which is to be uploaded.  By default
135 dgit push looks for single .changes file in the parent directory whose
136 filename suggests they it is for the right package and version.
137 .SH CONFIGURATION
138 dgit looks at the following git config keys to control its behaviour.
139 You may set them with git-config (either in system-global or per-tree
140 configuration), or provide
141 .BI -c key = value
142 on the dgit command line.
143 .TP
144 .BI dgit-suite. suite .distro
145 .TP
146 .BI dgit.default.distro
147 .TP
148 .BI dgit.default.username
149 .TP
150 .BI dgit-distro. distro .git-url
151 .TP
152 .BI dgit-distro. distro .git-host
153 .TP
154 .BI dgit-distro. distro .git-proto
155 .TP
156 .BI dgit-distro. distro .git-path
157 .TP
158 .BI dgit-distro. distro .git-check
159 .TP
160 .BI dgit-distro. distro .git-create
161 .TP
162 .BI dgit-distro. distro .upload-host
163 .TP
164 .BI dgit-distro. distro .mirror
165 .TP
166 .BI dgit-distro. distro .archive-query
167 .TP
168 .BI dgit-distro. distro .ssh
169 .TP
170 .BR dgit.default. *
171 for each
172 .BR dgit-distro. \fIdistro\fR . *
173 .SH BUGS
174 dgit will only work with packages in main. The madison http query API
175 does not give the component.
176
177 dgit assumes knowledge of the archive layout.  There appears to be no
178 sane way to find the path in the archive pool of the .dsc for a
179 particular suite.
180
181 We should be using some kind of vhost/vpath setup for the git repos on
182 alioth, so that they can be moved later if and when this turns out to
183 be a good idea.
184
185 Debian Policy needs to be updated to describe the new Vcs-Git-Master
186 field (and to specify that it is an RC bug for that field to refer
187 to an unavailable commit).
188
189 dgit push should perhaps do `git push origin', or something similar,
190 by default.
191
192 The mechanism for checking for and creating per-package repos on
193 alioth is a hideous bodge.  One consequence is that dgit currently
194 only works for people with push access.
195
196 Debian Maintainers are currently not able to push, as there is not
197 currently any mechanism for determining and honouring the archive's
198 ideas about access control.  Currently only DDs can push.
199
200 dgit's representation of format `3.0 (quilt)' source packages (even if
201 they were supported) would not represent the patch stack.  Currently
202 the patch series representation cannot round trip through the archive.
203 Ideally dgit would represent a quilty package with an origin commit of
204 some kind followed by the patch stack as a series of commits followed
205 by a pseudo-merge (to make the branch fast-forwarding).  This would
206 also mean a new `dgit rebase-prep' command or some such to turn such a
207 fast-forwarding branch back into a rebasing patch stack, and a `force'
208 option to dgit push (perhaps enabled automatically) which will make
209 the required pseudo-merge.
210
211 dgit's handling of .orig.tar.gz is not very sophisticated.  Ideally
212 the .orig.tar.gz could be transported via the git repo as git tags.
213
214 The error messages are often unhelpfully terse and tend to refer to
215 line numbers in dgit.
216
217 The option parser requires values to be cuddled to the option name.
218
219 --dry-run often does not work with fetch, even though this is a
220 logically plausible request.  (It fails, instead.)