1 \documentclass[10pt]{beamer}%{{{
5 \setbeamercovered{transparent}
8 \usepackage[english]{babel}
9 \usepackage[utf8]{inputenc}
13 %\usepackage[T1]{fontenc}
14 \newcommand{\git}{GIT}
17 \title{Packaging with \git}
19 \author{Pierre Habouzit}
21 \institute{FOSDEM 2008 - Debian Room}
25 \AtBeginSubsection[] {
26 \begin{frame}<beamer>{Why choosing \git}
27 \tableofcontents[currentsection,currentsubsection]
41 \section{Why choosing \git}%{{{
43 \begin{frame}{Because SVN isn't good enough}
44 I've packaged with SVN on svn.debian.org for a long time…
45 \uncover<2->{\alert{well, it sucks}:}
47 \item<3-> I wasn't able to work without network access;
48 \item<4-> I couldn't work incrementally: you have to get other's patches;
49 \item<5-> I couldn't "try and see" and maybe discard some work without
50 reverting patches: SVN never forgets;
51 \item<6-> I like having the full upstream source at hand, but svn explodes
52 doing that for large sources (KDE …).
56 \begin{frame}{Because \git{} does what I need}
57 With \git, as a DSCM, most of the issues are gone.
59 \item<2-> Off-line work is possible, in fact you always work off-line;
60 \item<3-> Incremental work is possible;
61 \item<4-> \git{} allow you to completely erase a wrong idea if you didn't
63 \item<5-> \git{} storage is extremely efficient: the marginal cost of
64 commits decreases with the number of commits.
68 \begin{frame}{A bit more about \git{} storage}
69 \git{} storage is very efficient and optimized. Some numbers:
73 xorg-xserver.git, goes back to 2000, is \alert{20Mo} big. The last
74 orig.tar.gz is 8Mo big, more than 84Mo unpacked.
79 dpkg.git, whole history since April 1996, generates a git pack of
80 \alert{15Mo}. The last dpkg release is 17Mo big unpacked.
85 GNU libc version 2.7 weights 115Mo unpacked. The full glibc history
86 (starts in the eighties) generates a \git{} pack of \alert{104Mo}.
91 Though, this won't probably true for packages with a lot of binary stuff
92 in it, where delta compression is less likely to produce good results
93 (games data packages come to mind).
97 \begin{frame}{A real maintainer toolbox}
98 \git{} is special, because it was designed by a {\bf Maintainer}. This has
101 \item<2-> \git{} operations to look at the history are blazingly fast;
102 \item<3-> \git{} operations to integrate patches are blazingly fast;
103 \item<4-> \git{} supports advanced merging features;
104 \item<5-> \git{} has advanced patch manipulation features.
110 In other words, \git{} is a suitable replacement for both SVN and
111 quilt\footnote{or your preferred patch system}.
116 \section{Repository layout}%{{{
117 \begin{frame}{The repository layout: upstream}
118 First of all, my repositories contain upstream sources.
120 \item<2-> if upstream uses a public SVN or \git{} repository, I track
121 their SCM under the {\tt upstream/*} namespace.
122 \item<3-> if upstream tarballs differ from the SCM, I also add a
123 {\tt upstream/tarballs} branch that replicates the tarball
125 \item<4-> if upstream only releases tarballs, I only have an
126 {\tt upstream} branch that is the successive import of tarballs.
128 \item<5-> last and not least, {\tt pristine-tar} helps me saving the
129 pristine upstream tarballs inside git.
133 \begin{frame}{The repository layout: upstream}
135 {\bf Demo}: tokyocabinet packaging:
137 \item Step 1: importing upstream;
138 \item Step 2: backing up the orig.tar.gz.
142 \begin{frame}{The repository layout: patches}
143 Second of all, instead of using quilt, I use a private git branch to hold my
144 patch queue (usually called {\tt \$\{upstream\_branch\}+patches}). There are many
147 \item<2-> I only use one tool: \git{};
148 \item<3-> quilt doesn't know about diff3, unpractical for partially merged
150 \item<4-> I believe it to be nicer to browse or to cherry-pick for
155 {\bf Demo:} let's rebase our patch branch for tokyocabinet !
159 \begin{frame}{The repository layout: debian packaging}
160 Finally, everything that is Debian specific is kept into a debian branch.
162 \item<2-> One branch per suite: {\tt debian-etch}, {\tt debian-sid}, {\tt
164 \item<3-> the corresponding upstreams are merged into this {\tt debian}
166 \item<4-> the {\tt upstream+patches} branch is serialized under
167 {\tt debian/patches}.
171 {\bf Demo:} let's release our tokyocabinet package !
175 \section{How to turn mud into gold efficiently}%{{{
176 \begin{frame}{Hiding to the world you're a dirty pig}
177 There is nothing more useless than a crappy SCM history. I don't know how
178 {\it you} work, but I tend to do everything at the same time.
182 Well, then just bind {\tt :wa} to {\tt :wa<cr>:!git commit -a} in your
188 Then work like a pig, compulsively saving\^{}Wcommiting your stuff…
193 And when you're happy of the current sate, let's pretend that you're a good
199 {\bf Demo}: the same in pictures.
202 \begin{frame}{Using \git{} for other's packages}
203 \git{} is not only useful as a versioning tool, it also helps to work fast
204 with NMUs and security uploads.
206 \item<2-> {\tt \$ git init \&\& git add .\@{} \&\& git commit -asm.}
207 \item<3-> {\it hack, hack …} {\tt \$ git commit -asm'try this'}
208 \item<4-> {\it hack, hack …} {\tt \$ git commit -asm'try that'}
209 \item<5-> {\it rebuild… Ok it works, let's produce a clean patch:}\\
210 {\tt \$ git rebase -i [...]}
215 Some packages don't rebuild twice in a row properly, because their
216 {\tt clean} target is broken…
220 \alert{I laugh at those}:\\
221 {\tt \$ git clean -d \&\& git reset --hard}
225 \section{The END !}%{{{
227 \begin{frame}{The END !}
228 If you're not too bored already, I'll gladly answer your questions now.
232 And remember, git has a tremendous community.
235 {\tt <mailto:git@vger.kernel.org>}
238 Also consult the documentation:
239 {\tt /usr/share/doc/git-doc/index.html}\footnote{I assume you have git-doc
240 installed, it will soon be part of base}.
244 % vim:tw=78 spell spelllang=en: