fix past tense after didn't
[~madcoder/fosdem.git] / git.tex
1 \documentclass[10pt]{beamer}%{{{
2
3 \mode<presentation> {
4   \usetheme{Warsaw}
5   \setbeamercovered{transparent}
6 }
7
8 \usepackage[english]{babel}
9 \usepackage[utf8]{inputenc}
10 \usepackage{times}
11 %\usepackage[T1]{fontenc}
12 \newcommand{\git}{GIT}
13
14
15 \title{Packaging with \git}
16
17 \author{Pierre Habouzit}
18
19 \institute{FOSDEM 2008 - Debian Room}
20
21 \date{23 Feb. 2008}
22
23 \AtBeginSubsection[] {
24   \begin{frame}<beamer>{Why choosing \git}
25     \tableofcontents[currentsection,currentsubsection]
26   \end{frame}
27 }
28
29 \begin{document}
30
31 \begin{frame}
32   \titlepage
33 \end{frame}
34
35 \begin{frame}
36   \tableofcontents
37 \end{frame}
38 %}}}
39 \section{Why choosing \git}%{{{
40
41 \begin{frame}{Because SVN isn't good enough}
42   I've packaged with SVN on svn.debian.org for a long time…
43   \uncover<2->{\alert{well, it sucks}:}
44   \begin{itemize}
45     \item<3-> I wasn't able to work without network access;
46     \item<4-> I couldn't work incrementally: you have to get other's patches;
47     \item<5-> I couldn't "try and see" and maybe discard some work without
48               reverting patches: SVN never forgets;
49     \item<6-> I like having the full upstream source at hand, but svn explodes
50               doing that for large sources (KDE …).
51   \end{itemize}
52 \end{frame}
53
54 \begin{frame}{Because \git{} does what I need}
55   With \git, as a DSCM, most of the issues are gone.
56   \begin{itemize}
57     \item<2-> Off-line work is possible, in fact you always work off-line;
58     \item<3-> Incremental work is possible;
59     \item<4-> \git{} allow you to completely erase a wrong idea if you didn't
60               share it yet;
61     \item<5-> \git{} storage is extremely efficient: the marginal cost of
62               commits decreases with the number of commits.
63   \end{itemize}
64 \end{frame}
65
66 \begin{frame}{A bit more about \git{} storage}
67   \git{} storage is very efficient and optimized. Some numbers:
68
69   \vspace{1em}
70   \uncover<2->{
71     xorg-xserver.git, goes back to 2000, is \alert{20Mo} big. The last
72     orig.tar.gz is 8Mo big, more than 84Mo unpacked.
73   }
74
75   \vspace{1em}
76   \uncover<3->{
77     dpkg.git, whole history since April 1996, generates a git pack of
78     \alert{15Mo}. The last dpkg release is 17Mo big unpacked.
79   }
80
81   \vspace{1em}
82   \uncover<4->{
83     GNU libc version 2.7 weights 115Mo unpacked. The full glibc history
84     (starts in the eighties) generates a \git{} pack of \alert{104Mo}.
85   }
86
87   \vspace{1em}
88   \uncover<5->{
89     Though, this won't probably true for packages with a lot of binary stuff
90     in it, where delta compression is less likely to produce good results
91     (games data packages come to mind).
92   }
93 \end{frame}
94
95 \begin{frame}{A real maintainer toolbox}
96   \git{} is special, because it was designed by a {\bf Maintainer}.  This has
97   several implications:
98   \begin{itemize}
99     \item<2-> \git{} operations to look at the history are blazingly fast;
100     \item<3-> \git{} operations to integrate patches are blazingly fast;
101     \item<4-> \git{} supports advanced merging features;
102     \item<5-> \git{} has advanced patch manipulation features.
103   \end{itemize}
104
105   \vspace{1ex}
106
107   \uncover<6->{
108     In other words, \git{} is a suitable replacement for both SVN and
109     quilt\footnote{or your preferred patch system}.
110   }
111 \end{frame}
112
113 %}}}
114 \section{Repository layout}%{{{
115 \begin{frame}{The repository layout: upstream}
116   First of all, my repositories contain upstream sources.
117   \begin{enumerate}
118     \item<2-> if upstream uses a public SVN or \git{} repository, I track
119               their SCM under the {\tt upstream/*} namespace.
120     \item<3-> if upstream tarballs differ from the SCM, I also add a
121               {\tt upstream/tarballs} branch that replicates the tarball
122               directly.
123     \item<4-> if upstream only releases tarballs, I only have an
124               {\tt upstream} branch that is the successive import of tarballs.
125
126     \item<5-> last and not least, {\tt pristine-tar} helps me saving the
127               pristine upstream tarballs inside git.
128   \end{enumerate}
129 \end{frame}
130
131 \begin{frame}{The repository layout: upstream}
132   \vspace{1ex}
133   {\bf Demo}: tokyocabinet packaging:
134   \begin{itemize}
135     \item Step 1: importing upstream;
136     \item Step 2: backing up the orig.tar.gz.
137   \end{itemize}
138 \end{frame}
139
140 \begin{frame}{The repository layout: patches}
141   Second of all, instead of using quilt, I use a private git branch to hold my
142   patch queue (usually called {\tt \$\{upstream\_branch\}+patches}). There are many
143   reasons to that:
144   \begin{itemize}
145     \item<2-> I only use one tool: \git{};
146     \item<3-> quilt doesn't know about diff3, unpractical for partially merged
147               patches;
148     \item<4-> I believe it to be nicer to browse or to cherry-pick for
149               upstreams.
150   \end{itemize}
151   \vspace{1ex}
152   \uncover<5->{
153     {\bf Demo:} let's rebase our patch branch for tokyocabinet !
154   }
155 \end{frame}
156
157 \begin{frame}{The repository layout: debian packaging}
158   Finally, everything that is Debian specific is kept into a debian branch.
159   \begin{itemize}
160     \item<2-> One branch per suite: {\tt debian-etch}, {\tt debian-sid}, {\tt
161               debian-exp};
162     \item<3-> the corresponding upstreams are merged into this {\tt debian}
163               branch;
164     \item<4-> the {\tt upstream+patches} branch is serialized under
165               {\tt debian/patches}.
166   \end{itemize}
167   \vspace{1ex}
168   \uncover<5->{
169     {\bf Demo:} let's release our tokyocabinet package !
170   }
171 \end{frame}
172 %}}}
173 \section{How to turn mud into gold efficiently}%{{{
174 \begin{frame}{Hiding to the world you're a dirty pig}
175   There is nothing more useless than a crappy SCM history. I don't know how
176   {\it you} work, but I tend to do everything at the same time.
177
178   \vspace{1em}
179   \uncover<2->{
180     Well, then just bind {\tt :wa} to {\tt :wa<cr>:!git commit -a} in your
181     editor…
182   }
183
184   \vspace{1em}
185   \uncover<3->{
186     Then work like a pig, compulsively saving\^{}Wcommiting your stuff…
187   }
188
189   \vspace{1em}
190   \uncover<4->{
191     And when you're happy of the current sate, let's pretend that you're a good
192     boy.
193   }
194
195   \vspace{1em}
196   \uncover<5->{
197     {\bf Demo}: the same in pictures.
198   }
199 \end{frame}
200 \begin{frame}{Using \git{} for other's packages}
201   \git{} is not only useful as a versioning tool, it also helps to work fast
202   with NMUs and security uploads.
203   \begin{enumerate}
204     \item<2-> {\tt \$ git init \&\& git add .\@{} \&\& git commit -asm.}
205     \item<3-> {\it hack, hack …} {\tt \$ git commit -asm'try this'}
206     \item<4-> {\it hack, hack …} {\tt \$ git commit -asm'try that'}
207     \item<5-> {\it rebuild… Ok it works, let's produce a clean patch:}\\
208               {\tt \$ git rebase -i [...]}
209   \end{enumerate}
210
211   \vspace{1ex}
212   \uncover<6->{
213     Some packages don't rebuild twice in a row properly, because their
214     {\tt clean} target is broken…
215   }
216
217   \uncover<7->{
218     \alert{I laugh at those}:\\
219     {\tt \$ git clean -d \&\& git reset --hard}
220   }
221 \end{frame}
222 %}}}
223 \section{The END !}%{{{
224
225 \begin{frame}{The END !}
226   If you're not too bored already, I'll gladly answer your questions now.
227
228   \vspace{2em}
229
230   And remember, git has a tremendous community.
231
232   \begin{center}
233   {\tt <mailto:git@vger.kernel.org>}
234   \end{center}
235
236   Also consult the documentation:
237   {\tt /usr/share/doc/git-doc/index.html}\footnote{I assume you have git-doc
238   installed, it will soon be part of base}.
239 \end{frame}
240 %}}}
241 \end{document}
242 % vim:tw=78 spell spelllang=en: