chiark / gitweb /
cyan background for badness
[talk-2014-debconf-dgit.git] / talk.txt
1 [title]
2
3 (PITCH)
4
5 [archive as vcs]
6
7 The Debian archive is (amongst other things) a version control system.
8
9 Clone (checkout) <=> apt-get source
10 Commit+push <=> upload
11
12 But the archive has no really sensible branching.  It history browsing
13 is appalling.  And it has pretty bad interaction with other VCSs.  In
14 particular we want to be using git.
15
16 So what to do ?
17
18 Well, we might replace it.  But the archive is various other things
19 besides an appallingly bad VCS.  And a lot of our co-developers are
20 used to it and fear and hate change.  So instead, we should have some
21 software to help deal with the problem:
22
23 What that really means is that we need a better gateway.  That's what
24 dgit is.
25
26 [manpage]
27
28 dgit is a tool which lets you treat the archive as if it were a git
29 server.
30
31 It provides uniform operation for all packages:
32
33 You can clone any package, work on it, build it, and upload it.
34
35 You don't need to know maintainer's workflow.  It doesn't matter
36 whether the maintainer uses dgit, other git tools, quilt, CVS or SCCS.
37
38 With dgit you do all direct source code management in git.  As a dgit
39 user you do not interact with the archive directly.
40
41 [start demo]
42
43 dgit is particularly useful for NMUers: you can prepare an RC bugfix,
44 with full support from git, without needing to know anything about the
45 package's usual VCS arrangements.
46
47 dgit also has great potential for downstreams - that is, derivatives
48 and users who want to modify a package.  Having used dgit clone or
49 fetch, you can merge into your downstream branch.  (There are some
50 issues with this right now for non-DDs, which I'm going to discuss
51 later.)
52
53 As a maintainer you can choose, if you like, to use the dgit git
54 history as your primary working history.  Any fast forwarding
55 patches-applied git workflow works with dgit.  In particular, you can
56 have the full upstream git history in the ancestry if your dgit git
57 history.
58
59
60 (PRINCIPLES OF OPERATION)
61
62 [ .dsc, dpkg-source -x, git checkout, identity ]
63
64 This is Debian so you want to know how it works.  So let me run
65 through dgit's principles of operation.  The data model is as follows:
66
67 A dgit-generated upload's .dsc contains a git commit hash.
68 This specifies a commit whose tree is identical to the results of
69 dpkg-source -x on the .dsc.
70
71 But the actual git history is not stored in the archive.  It is
72 obtained via the git protocol from an actual git server.  (Currently
73 this is on alioth but it's going to move.)
74
75 The only other constraint on the git commit named in the .dsc is that
76 the successive dgit uploads must have a fast-forwarding history.
77 Specifically, each upload made with dgit must have as an ancestor the
78 current state of that package in the archive.
79
80 I should expand a bit on the need for the git commit to be identical
81 to the source package.  dgit is (amongst other things) a way of
82 looking at source packages, and their history, using git.  That means
83 that the git tree has to be the same as the package tree.
84 Specifically, for example, files like configure need to either be in
85 both git and the source package, or neither.
86
87 [ synthetic commit example ]
88
89 Non-dgit uploads don't have a (suitable) git commit hash.  But
90 dgit clone needs to produce a suitable git commit.  It does this by
91 inventing (in a deterministic way) a commit corresponding to the state
92 of the archive.  If necessary, it also generates a synthetic merge
93 commit to tie the invented commit into the previous dgit history.
94
95 (QUILTY WORKFLOW)
96
97 [ synthetic patch example ]
98
99 At the moment, dgit doesn't attempt to do anything clever with `3.0
100 (quilt)' source packages.
101
102 The synthetic git history generated from non-dgit uploads does not
103 represent the quilt patch stack.  And conversely, dgit push involves
104 dpkg-source commit, to make the git tree be the same as dpkg-source
105 would extract.  So dgit has to make some patches, and currently it
106 makes single synthetic patch whose description contains some info from
107 git log.
108
109 Overall this means that currently when you work on a quilty package in
110 dgit, you don't interact with the quilt patch stack.  This is less
111 than ideal.
112
113 I intend to improve this, perhaps by having dgit use git-dpm as a
114 bidirectional gateway between `3.0 (quilt)' and git.  Exactly how to
115 do this involves some complicated design decisions which I haven't
116 entirely worked out yet.  The intent, though, is that there will be an
117 option to generate a rebasing-style git branch.  After a patch series
118 has been edited with rebase, dgit push will generate a `fake merge'
119 commit to make the resulting history fast-forwarding.
120
121 (ACCESS PROBLEMS)
122
123 [table]
124
125 Probably the biggest problem with dgit right now is that it is only
126 useable for DDs.  This is particularly galling for a tool which is
127 especially useful for users, downstreams, mentees, and so forth.
128
129 There are two obstacles to widening the access, one relating to the
130 archive and one to the git server.
131
132 Firstly, dgit needs to query the archive to find the current version
133 of the package and obtain a copy of the .dsc.  At the moment there is
134 no official interface which provides this data.  There is the rmadison
135 server but it sometimes serves stale or wrong data and there is no
136 authentication - that is, there is no way for the client to tell that
137 the data is accurate.  So what dgit does right now is ssh to coccia
138 and run SQL commands against its mirror of the ftpmaster database.
139 This is obviously mad.  ftpmaster have promised me a proper query
140 service API (via HTTP and TLS).
141
142 Secondly, dgit is currently using alioth as its git server, and the
143 collab-maint group there for authentication.  This is not ideal for a
144 number of reasons.  Alioth does a lot of other things and is therefore
145 less secure and reliable than would be ideal.  dgit's required
146 authentication model is not a very good fit for alioth's
147 infrastructure.  We intend to move this to a VM of its own - I've
148 spoken to DSA (in the person of Tollef) about this.
149
150 [questions etc.]
151
152 The package itself is in testing, and you can simply install the same
153 .deb on stable if you want.
154
155 So that's what I had prepared to say.  I think I have time for
156 questions.