chiark / gitweb /
8e1a0b24d2af9187f60247e818bbb92de8b88d50
[talk-2015-debconf-dgit.git] / talk.txt
1
2 ==== overview slide
3
4
5 Hi.  I'm here to plug dgit, which is a system for treating the Debian
6 archive like a git remote.
7
8 I'm going to talk for about 35 minutess and then I'll take questions.
9
10
11 When we work on Debian we take on different roles.  The biggest
12 difference is between the maintainer (or maintainers) of a package,
13 working on their own package, and everyone else.
14
15 I'm going to start by presenting dgit from the point of view of
16 everyone else: NMUers, sponsorship, teams doing cross-archive work
17 like transitions and reproducible builds, bug squashers, downstreams,
18 users, and so on.  Maintainers, please be patient - I'll get to you.
19
20
21 ==== data flow slide
22
23 The point of dgit is that it lets everyone treat the archive as if it
24 were a git repository.
25
26 You can dgit clone any package, in any suite (so, for example, sid or
27 experimental) and you will get a git tree which is exactly the same as
28 dpkg-source -x.
29
30 You can then work on the package in git, the way you would work in git
31 with any other project.  In particular, you can:
32
33  * commit locally
34  * cherry pick changes from other branches
35  * git reset, git clean
36  * git rebase -i to polish a more complex set of changes into
37    a patch queue
38
39 If you have the right authority you can also dgit push, to upload
40 (after doing a build).
41
42 If you want so share your work-in-progress with others, you can git
43 push your branch anywhere suitable, so they can fetch it.  So, for
44 example, you could share your branch with your sponsor, who could
45 then approve it by running dgit push.
46
47 ==== NMU linear history slide
48
49 The dgit history structure is up to the maintainer.  If you are doing
50 a straightforward NMU you should produce a well-structured linear
51 sequence of commits, as you would for any git upstream.  If the source
52 package is `3.0 (quilt)', you shouldn't touch debian/patches; dgit
53 will take care of that for you.
54
55 ==== NMU linear history on top of basic dgit history
56
57 Unless the maintainer uses dgit, the history you see in dgit will not
58 be the maintainer's history.  This is because maintainers' git
59 branches often differ from the source packages in the archive.
60
61 So dgit may have to synthesise a git history.  The history you see in
62 dgit will then have a very basic branch and commit structure, rather
63 than representing the package's actual history.
64
65
66 Which brings me onto the other side of this talk: dgit for
67 maintainers:
68
69 ==== history comparison slide
70
71 For the reasons I've explained, downstream dgit users would like you
72 to use dgit push.  They will then be able to see, and directly work
73 with, your own history.
74
75 But it's in your own interests, too:
76
77 If you use dgit, you will be able to directly merge NMUs, patches
78 proposed via pull-request emails, and so on: Because, in this case,
79 the dgit-using contributor will have based their work on your own
80 history.
81
82 Using dgit for your maintainer uploads will put your own history on
83 browse.dgit.debian.org, rather than advertising dgit's stub history
84 (which can also be out of date).
85
86 If you use dgit push, you get an extra check that the source package
87 you are uploading is exactly the same as your git HEAD.  This can
88 save you some dsc-based checks.
89
90 And, as I say, non-maintainer dgit users will thank you.
91
92
93 ==== data flow slide
94
95 dgit is not a replacement for existing git packaging tools; it's
96 intended to complement them.  So (unlike git-dpm) dgit does not define
97 a git history structure; nor does it define a branch structure or
98 require a particular source format.
99
100
101 ==== data flow slide with EQUAL and FF
102
103 dgit push imposes only two requirements on your git trees, which stem
104 directly from dgit's goals.
105
106 The most important requirement is that your git tree is identical to
107 the unpacked source package.  (Technically, in the case of a `3.0
108 (quilt)' package, it is what is sometimes called a `patches-applied
109 packaging branch without .pc'.)
110
111 For all native packages, and for users of git-dpm and raw git, this is
112 already the interchange format.  These maintainers can start using
113 dgit right away.  Please do!
114
115 For those using git-buildpackage with `3.0 (quilt)', things are a bit
116 more complicated.  I'm told that gbp pq can be used to generate a
117 patches-applied branch, and that some users prefer to use that as the
118 interchange git branch, but I know this is far from universal.  I'm
119 talking to the git-buildpackage maintainers about gbp integration.
120
121
122 The other requirement of dgit is simply that the dgit branches are
123 fast-forwarding.  So if your tools have made a rebasing branch, you
124 may need to do something like
125    git merge -s ours dgit/sid
126 before pushing.  I'm intending to provide some rather more cooked
127 way to do this but I haven't decided the exact shape yet.
128
129
130 ==== data flow slide
131
132 There are a few other things I ought to cover, since they often come
133 up.  They're are relevant to maintainers and non-maintainers:
134
135
136 DMs currently need to email me a signed copy of their ssh key, in
137 order to be able to push.
138
139
140 The dgit view does not generally include the package upload history.
141 git-import-dscs can produce a git branch representing the upload
142 history, but dgit doesn't run that itself.
143
144 One could push such a branch to the archive with dgit push.  But, it
145 seems to me that the git history structure ought to up to the
146 maintainer, and if the maintainer chooses to use dgit, the
147 maintainers's existing git history is probably better.
148
149
150 It is normally best to use one of dgit's build operations to build for
151 upload.  This is mainly because most other tools remove .gitignore by
152 default.  dgit requires that the source package and git tree are the
153 same, so if your git tree has .gitignore in it, your source package
154 should too.
155
156
157 Many packages have strangely-behaved or plain buggy clean targets.
158 Because dgit knows that your git tree is canonical, it can help work
159 around this: you can tell dgit to use git clean instead, avoiding the
160 package's clean target entirely.
161
162
163 Some source packages contain files not in the maintainers' git
164 branches, and which are needed to build: most commonly, autotools
165 output.  Such git branches are not useable with dgit.
166
167 But nowadays most people recommend that the package build should
168 always rerun autotools.  If you do that, then neither your git tree
169 nor your source package need contain the autotools output and all is
170 well.
171
172 Alternatively, you can commit the autotools output to git.
173
174
175 ==== Future plans slide
176
177 I have a number of plans for the future, some of which I need help
178 with.  But I don't have time, I'm afraid, to go through them.
179
180 Instead, I'm going to open the talk up to questions now.