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