chiark / gitweb /
urls
[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 [ synthetic commit example ]
81
82 Non-dgit uploads don't have a (suitable) git commit hash.  But
83 dgit clone needs to produce a suitable git commit.  It does this by
84 inventing (in a deterministic way) a commit corresponding to the state
85 of the archive.  If necessary, it also generates a synthetic merge
86 commit to tie the invented commit into the previous dgit history.
87
88 (QUILTY WORKFLOW)
89
90 [ synthetic patch example ]
91
92 At the moment, dgit doesn't attempt to do anything clever with `3.0
93 (quilt)' source packages.
94
95 The synthetic git history generated from non-dgit uploads does not
96 represent the quilt patch stack.  And conversely, dgit push involves
97 dpkg-source commit, to make the git tree be the same as dpkg-source
98 would extract.  So dgit has to make some patches, and currently it
99 makes single synthetic patch whose description contains some info from
100 git log.
101
102 Overall this means that currently when you work on a quilty package in
103 dgit, you don't interact with the quilt patch stack.  This is less
104 than ideal.
105
106 I intend to improve this, perhaps by having dgit use git-dpm as a
107 bidirectional gateway between `3.0 (quilt)' and git.  Exactly how to
108 do this involves some complicated design decisions which I haven't
109 entirely worked out yet.  The intent, though, is that there will be an
110 option to generate a rebasing-style git branch.  After a patch series
111 has been edited with rebase, dgit push will generate a `fake merge'
112 commit to make the resulting history fast-forwarding.
113
114 (ACCESS PROBLEMS)
115
116 [table]
117
118 Probably the biggest problem with dgit right now is that it is only
119 useable for DDs.  This is particularly galling for a tool which is
120 especially useful for users, downstreams, mentees, and so forth.
121
122 There are two obstacles to widening the access, one relating to the
123 archive and one to the git server.
124
125 Firstly, dgit needs to query the archive to find the current version
126 of the package and obtain a copy of the .dsc.  At the moment there is
127 no official interface which provides this data.  There is the rmadison
128 server but it sometimes serves stale or wrong data and there is no
129 authentication - that is, there is no way for the client to tell that
130 the data is accurate.  So what dgit does right now is ssh to coccia
131 and run SQL commands against its mirror of the ftpmaster database.
132 This is obviously mad.  ftpmaster have promised me a proper query
133 service API (via HTTP and TLS).
134
135 Secondly, dgit is currently using alioth as its git server, and the
136 collab-maint group there for authentication.  This is not ideal for a
137 number of reasons.  Alioth does a lot of other things and is therefore
138 less secure and reliable than would be ideal.  dgit's required
139 authentication model is not a very good fit for alioth's
140 infrastructure.  We intend to move this to a VM of its own - I've
141 spoken to DSA (in the person of Tollef) about this.
142
143 [questions etc.]
144
145 The package itself is in testing, and you can simply install the same
146 .deb on stable if you want.
147
148 So that's what I had prepared to say.  I think I have time for
149 questions.