]> git.ipfire.org Git - people/ms/talks.git/blob - 2015_-_Submitting_Patches/main.tex
Add talk: Submitting Patches
[people/ms/talks.git] / 2015_-_Submitting_Patches / main.tex
1
2 \documentclass[serif,mathserif,compress]{beamer}
3
4 \usepackage{beamerthemesplit}
5
6 \usetheme{default}
7 \useoutertheme{default}
8
9 \usepackage[british]{babel}
10 \usepackage{amsmath}
11 \usepackage{amsfonts}
12 \usepackage{color}
13 \usepackage{epsfig}
14 \usepackage{listings}
15 \usepackage{marvosym}
16 \usepackage{texnansi}
17 \usepackage{verbatim}
18 \usepackage{xspace}
19
20 % Make this a 16:9 presentation
21 \setlength{\paperwidth}{171 mm}
22 \setlength{\paperheight}{96 mm}
23 \setlength{\textwidth}{151 mm}
24 \setlength{\textheight}{86 mm}
25
26 \usepackage[default,osfigures,scale=0.95]{opensans}
27 \usepackage[T1]{fontenc}
28 \usepackage[utf8]{inputenc}
29
30 % Set sans-serif font.
31 %\renewcommand\sfdefault{phv}
32 %\renewcommand\familydefault{\sfdefault}
33
34 % Define some colours.
35 \definecolor{myred}{rgb}{0.53,0.01,0}
36 \definecolor{mygrey}{rgb}{0.3,0.3,0.3}
37
38 % Make a nice gradient as background.
39 %\setbeamertemplate{background canvas}[vertical shading]
40 %[bottom=black, middle=myred, top=myred]
41 \setbeamercolor{background canvas}{bg=white, fg=mygrey}
42 \setbeamercolor{frametitle}{fg=mygrey,bg=mygrey!20}
43 \setbeamercolor{section in head/foot}{bg=myred}
44 \setbeamercolor{subsection in head/foot}{fg=white}
45 \setbeamercolor{author in head/foot}{bg=myred}
46 \setbeamercolor{date in head/foot}{fg=white}
47
48 % Highlight elements in some sort of grey.
49 \setbeamercolor{structure}{fg=mygrey}
50 \setbeamercolor{normal text}{bg=black, fg=mygrey}
51
52 % Use round bullets in lists.
53 \setbeamertemplate{items}[circle]
54
55 % Use bigger fonts for titles.
56 \setbeamerfont{title}{size=\Huge}
57 \setbeamerfont{frametitle}{size=\large}
58
59 % Don't clutter the pages with useless navigations.
60 \setbeamertemplate{navigation symbols}{}
61
62 \lstdefinestyle{console}{%
63 language=bash,
64 basicstyle=\ttfamily\fontsize{3.5}{6}\selectfont\color{white},
65 frame=none,
66 rulecolor=\color{white},
67 backgroundcolor=\color{black},
68 breaklines=false,
69 breakindent=0pt,
70 lineskip={0pt},
71 escapeinside={<@}{@>}
72 }
73
74 % Author information.
75 \author[Michael Tremer]{Michael Tremer}
76 \institute{IPFire Project}
77
78 % The title of the presentation.
79 \title{Submitting Patches}
80 \subtitle{Contributing to the IPFire project made easy}
81
82 \date{October 10\textsuperscript{th}, 2015}
83
84 \newcommand{\spacer}{\vspace{4 mm}}
85
86 \newcommand{\screenshot}[1]{\centerline{%
87 \includegraphics[width=\textwidth]{#1}}}
88
89 \newcommand{\slug}[1]{
90 \vspace*{\fill}
91
92 \begin{center}
93 \LARGE #1
94 \end{center}
95
96 \vspace*{\fill}
97 }
98
99 \newcommand{\subslug}[1]{
100 \slug{\normalsize #1}
101 }
102
103 \begin{document}
104 \maketitle
105
106 %\section*{Outline}
107 %\frame{\tableofcontents}
108
109 \section{Introduction}
110
111 \begin{frame}
112 \slug{We are an Open Source project \\
113 \pause ... and use an open development approach}
114 \end{frame}
115
116 \begin{frame}
117 \slug{Everyone is welcome to contribute}
118 \subslug{No skills required}
119 \end{frame}
120
121 \begin{frame}
122 \slug{This might look complicated \\
123 - it is mostly common sense}
124 \end{frame}
125
126 \begin{frame}
127 \slug{Why does all this matter? \\
128 \pause Our brains are good with patterns}
129 \end{frame}
130
131 \section{Obtaining the Sources}
132
133 \begin{frame}
134 \slug{We are using \texttt{git}}
135 \end{frame}
136
137 \begin{frame}
138 \slug{Everything we do is in a git repository somewhere on \\
139 \url{http://git.ipfire.org}}
140 \end{frame}
141
142 \subsection{Setting up Git}
143
144 \begin{frame}
145 \frametitle{Setting up Git}
146
147 \slug{Introduce yourself}
148
149 \subslug{We want to know who you are \\
150 Real name required}
151 \pause
152
153 \subslug{
154 \texttt{git config ----global user.name ``Michael Tremer''} \\
155 \texttt{git config ----global user.email michael.tremer@ipfire.org}
156 }
157 \end{frame}
158
159 \subsection{Setting up Git for Email}
160
161 \begin{frame}
162 \frametitle{Setting up Git for Email}
163
164 \slug{Git needs to send email...}
165
166 \subslug{
167 \texttt{git config ----global sendemail.smtpencryption tls} \\
168 \texttt{git config ----global sendemail.smtpserver mail01.ipfire.org} \\
169 \texttt{git config ----global sendemail.smtpserverport 587} \\
170 \texttt{git config ----global sendemail.smtpuser ms}
171 }
172
173 \subslug{(You can use what ever mail server you want...)}
174 \end{frame}
175
176 \subsection{Creating a Development Branch}
177
178 \begin{frame}
179 \frametitle{Creating a Development Branch}
180
181 \begin{columns}[T] % align columns
182 \begin{column}{.78\textwidth}
183 \slug{We use development branches for each feature}
184
185 \subslug{
186 \texttt{git checkout -b my-feature -t origin/master}
187 }
188 \end{column}%
189 \hfill%
190 \begin{column}{.28\textwidth}
191 \includegraphics[height=.85\textheight]{res/git-branches}
192 \end{column}%
193 \end{columns}
194 \end{frame}
195
196 \section{Making Changes}
197
198 \begin{frame}
199 \slug{Time to hack...}
200 \pause
201
202 \subslug{But there are some rules...}
203 \end{frame}
204
205 \begin{frame}
206 \subslug{Check with us before starting working on bigger things}
207 \pause
208
209 \subslug{Separate your changes \\
210 e.g. bug fixes vs. performance enhancements}
211 \pause
212
213 \subslug{Send small patches \\ each one justifiable on its own merits}
214 \pause
215
216 \subslug{Make sure that everything builds \\ mark dependencies}
217 \pause
218
219 \subslug{Style-check your changes}
220 \pause
221
222 \subslug{Test!}
223 \end{frame}
224
225 \subsection{Committing Changes}
226
227 \begin{frame}
228 \frametitle{Committing Changes}
229
230 \slug{Committing a patch means \\ adding it to the project's history}
231 \pause
232
233 \subslug{It will be in there for forever}
234 \end{frame}
235
236 \subsection{Writing a commit message}
237
238 \begin{frame}
239 \frametitle{Writing a good commit message}
240
241 \slug{Describe your changes}
242 \pause
243
244 \subslug{What motivated you to develop this patch?}
245 \subslug{What is the impact of the patch?}
246 \subslug{Are there user-visible changes?}
247 \end{frame}
248
249 \begin{frame}
250 \frametitle{Writing a good commit message}
251
252 \slug{Describe \underline{how} you solved the problem}
253 \pause
254
255 \subslug{Include technical details}
256 \subslug{(If this step is getting difficult your patch is probably too complex)}
257 \end{frame}
258
259 \begin{frame}
260 \frametitle{Writing a good commit message}
261
262 \slug{Add useful information}
263 \pause
264
265 \subslug{Bug IDs}
266 \subslug{Mailing list discussions \\
267 (including a quick summary)}
268 \end{frame}
269
270 \subsection{Git Tags}
271
272 \begin{frame}
273 \frametitle{Git tags - Who did what?}
274
275 \slug{Sign your work}
276
277 \subslug{\texttt{Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>}}
278 \end{frame}
279
280 \begin{frame}
281 \frametitle{Git tags - Who did what?}
282
283 \slug{Credit your collaborators}
284
285 \subslug{Reported-by: | Tested-by: | Reviewed-by: | Suggested-by:}
286 \end{frame}
287
288 \subsection{Why all this?}
289
290 \begin{frame}
291 \slug{Why all this?}
292 \pause
293
294 \subslug{Commit messages will be read by the reviewers of your patch... \\
295 \pause (help them to make reviewing your changes easier)}
296
297 \pause
298 \subslug{...and after many years}
299 \end{frame}
300
301 \section{Review}
302
303 \begin{frame}
304 \slug{Every patch must be reviewed}
305
306 \subslug{Respond to any comments - don't get discouraged - or impatient}
307 \end{frame}
308
309 \begin{frame}
310 \frametitle{Who to send patches to?}
311
312 \slug{The maintainer of a subsystem}
313 \slug{\underline{and} at least one mailing list}
314 \end{frame}
315
316 \subsection{Submitting Patches}
317
318 \begin{frame}
319 \slug{We use email only}
320
321 \subslug{Pull requests only for bigger changes \& maintainers \\
322 No GitHub pull requests}
323 \end{frame}
324
325 \begin{frame}
326 \frametitle{Patch format}
327
328 \begin{itemize}
329 \item Must include a From: header (with the real name and email address)
330 \item Subject line starting with \texttt{[PATCH]}
331 \item The commit message
332 \item \texttt{Signed-off-by:} line
333 \item The actual changes in the unified diff format
334 \end{itemize}
335 \pause
336
337 \slug{\texttt{git send-email} automates all that}
338 \end{frame}
339
340 \subsection{Patchwork}
341
342 \subsection{Track what is going on...}
343
344 \begin{frame}
345 \frametitle{Track what is going on...}
346
347 \slug{\url{http://patchwork.ipfire.org/}}
348 \pause
349
350 \subslug{Help us reviewing patches}
351 \end{frame}
352
353 \section*{The End}
354
355 \begin{frame}
356 \begin{center}
357 \includegraphics[height=.5\textheight]{res/ipfire_tux_512x512.png}
358 \end{center}
359
360 \subslug{
361 Read everything on \\
362 \url{http://wiki.ipfire.org/devel/submit-patches}
363 }
364 \end{frame}
365 \end{document}