-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimpress.html
385 lines (345 loc) · 12.6 KB
/
impress.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=1024" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>Git vs. Mercurial</title>
<meta name="description" content="Git vs. Mercurial presentation" />
<meta name="author" content="Adam Parchimowicz" />
<link href="http://fonts.googleapis.com/css?family=Open+Sans:regular,semibold,italic,italicsemibold|PT+Sans:400,700,400italic,700italic|PT+Serif:400,700,400italic,700italic" rel="stylesheet" />
<link href="impress.css" rel="stylesheet" />
<script src="jquery-1.9.1.min.js"></script>
<link rel="shortcut icon" href="favicon.png" />
</head>
<body>
<div id="impress" data-transition-duration="1100">
<div id="start" class="step intro" data-x="-2318" data-y="-1773" data-z="1" data-scale="0.16">
<img src="roche_logo.png" />
</div>
<div id="intro" class="step slide intro" data-x="-2000" data-y="-1500">
<q><br/><br/>Git workshop<br/>Adam Parchimowicz</q>
</div>
<div id="svngitmercurial" class="step svn" data-x="-3300" data-y="-500" data-scale="1.2" data-rotate="180">
<p>SVN / Git / Mercurial</p>
</div>
<div class="step slide svn" data-x="-3250" data-y="-1325" data-scale="1.5" data-rotate="180">
<q>SVN, apart from being centralized, has a couple important characteristics:
<ul>
<li>stores changesets in deltas</li>
<li>poor branching model</li>
<li>dead simple</li>
</ul>
</q>
</div>
<div class="step imgslide svn" data-x="-3630" data-y="-2120" data-scale="0.7" data-rotate="0">
<q>Rough representation of SVN and Mercurial storage model</q>
<div><img src="svn-deltas.png" /></div>
</div>
<div class="step imgslide svn" data-x="-2880" data-y="-2120" data-scale="0.7" data-rotate="0">
<q>Rough representation of Git storage model</q>
<div><img src="git-repo-model.png" /></div>
</div>
<div class="step slide svn" data-x="-2880" data-y="-2650" data-scale="0.7" data-rotate="180">
<q>Branching model.
<ul>
<li>In SVN branch is just a folder copy</li>
<li>Git has lightweight local branches and tracking branches</li>
<li>Mercurial has annotated branches and bookmarks</li>
</ul>
</q>
</div>
<div class="step slide svn" data-x="-3630" data-y="-2650" data-scale="0.7" data-rotate="0">
<q>Merging changes between branches - ever tried this in SVN?</q>
<q>Branch merging in SVN is a nightmare. In <strong>Git</strong> and <strong>Mercurial</strong> it just works!</q>
</div>
<div id="commandsComparison" class="step hideable svn" data-x="-3630" data-y="-3180" data-scale="0.7" data-rotate="0">
<table style="width: 900px;">
<tbody>
<tr style="border-bottom: 1px solid black;">
<th>
<h4><strong>Subversion (SVN)</strong></h4>
</th>
<th>
<h4><strong>Mercurial (Hg)</strong></h4>
</th>
<th>
<h4><strong>Git</strong></h4>
</th>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn add</td>
<td><strong>hg add</strong></td>
<td><strong>git add</strong></td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn blame</td>
<td><strong>hg blame</strong></td>
<td><strong>git blame</strong></td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn cat</td>
<td><strong>hg cat</strong></td>
<td>git show</td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn checkout</td>
<td>hg clone</td>
<td>git clone</td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn commit</td>
<td>hg commit ; hg push</td>
<td>git commit -a ; git push</td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn delete/remove</td>
<td><strong>hg remove</strong></td>
<td>git rm</td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn diff</td>
<td><strong>hg diff</strong></td>
<td><strong>git diff</strong>, git diff --cached</td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn help</td>
<td><strong>hg help</strong></td>
<td><strong>git help</strong></td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn log</td>
<td><strong>hg log</strong></td>
<td><strong>git log</strong></td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn revert</td>
<td><strong>hg revert</strong></td>
<td>git checkout -f</td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn status</td>
<td><strong>hg status</strong></td>
<td><strong>git status</strong></td>
</tr>
<tr style="border-bottom: 1px solid lightgrey;">
<td>svn update</td>
<td>hg pull --update</td>
<td>git pull</td>
</tr>
<tr>
<td>svn move/rename</td>
<td><strong>hg move/rename</strong></td>
<td>git mv</td>
</tr>
<tr>
<td>?</td>
<td>hg backout</td>
<td>git revert</td>
</tr>
</tbody>
</table>
<p>Source: <a href="http://blogs.atlassian.com/2012/02/mercurial-vs-git-why-mercurial/">http://blogs.atlassian.com/2012/02/mercurial-vs-git-why-mercurial/</a> + edits</p>
</div>
<div id="git" class="step git" data-x="-4500" data-y="-1750" data-scale="2" data-rotate="90">
Git theory
</div>
<div class="step imgslide git" data-x="-4700" data-y="-800" data-scale="0.4" data-rotate="0">
<q>One important fact - GIT is DAG.
</q><br/>
<img src="dag.png" />
</div>
<div class="step imgslide git" data-x="-4300" data-y="-800" data-scale="0.4" data-rotate="0">
<q>Git's commit is an object that points to its tree. This tree itself points to other trees or blobs.
</q>
<img src="git-commit-internal.png" />
</div>
<div class="step imgslide git" data-x="-4300" data-y="-500" data-scale="0.4" data-rotate="0">
<q>Git's repo is a bunch of objects and pointers:
<ul class="small">
<li>head and branch are pointers</li>
<li>commit is an object that points to its parents</li>
</ul>
</q>
<img src="git-repo-commits.png" />
</div>
<div id="just-graph" class="step imgslide git" data-x="-4300" data-y="-500" data-scale="0.4" data-rotate="0">
<img class="first" src="git-repo-commits.png" />
</div>
<div id="graph-w-tree" class="step imgslide git" data-x="-4300" data-y="-500" data-scale="0.4" data-rotate="0">
<img src="git-repo-commits-w-tree.png" />
</div>
<div class="step imgslide git" data-x="-4700" data-y="-500" data-scale="0.4" data-rotate="0">
<img src="git-full-tree.png" style="float: right; margin: 150px 50px 0 0; height: 400px;" />
</div>
<div id="fullTreeWithRefs" class="step imgslide git" data-x="-4700" data-y="-500" data-scale="0.4" data-rotate="0">
<img src="git-full-tree-w-refs.png" style="float: right; margin: 150px 50px 0 0; height: 400px;" />
</div>
<div class="step slide git" data-x="-4700" data-y="-200" data-scale="0.4" data-rotate="0">
<q>
In Git a commit is identified by a SHA1 of its contents and parent(s). Therefore it is immutable.
</q>
<q>
The same applies to all Git's objects. This makes up for great consistency!
</q>
</div>
<div class="step slide git" data-x="-4300" data-y="-200" data-scale="0.4" data-rotate="0">
<q>
Rewriting history
<ul>
<li>You can ammend last commit.</li>
<li>Rebase instead of merging.</li>
<li>Interactive rebase power!</li>
</ul>
</q>
</div>
<div id="git1" class="step slide gitimg" data-x="-4300" data-y="100" data-scale="0.4" data-rotate="0">
<q>Repo:</q>
<img src="Git1.png" />
</div>
<div id="git2"class="step slide gitimg" data-x="-4300" data-y="100" data-scale="0.4" data-rotate="0">
<q>git reset b4e6fc</q>
<img src="Git2.png" />
</div>
<div id="git3" class="step slide gitimg" data-x="-4300" data-y="100" data-scale="0.4" data-rotate="0">
<q>Reflog still has a pointer!</q>
<img src="Git3.png" />
</div>
<div id="git4" class="step slide gitimg" data-x="-4300" data-y="100" data-scale="0.4" data-rotate="0">
<q>git branch branch2 273a31</q>
<img src="Git4.png" />
</div>
<div class="step slide" data-x="-4700" data-y="100" data-scale="0.4" data-rotate="0">
<q>
Git powertools:
<ul>
<li>stash</li>
<li>reflog</li>
<li>cherrypick</li>
<li>bisect</li>
<li>rebase -i</li>
</ul>
</q>
</div>
<div id="reset1" class="reset step slide" data-x="-4300" data-y="400" data-scale="0.4" data-rotate="0">
<q>Behold the power of reset!</q>
<img src="ex4.png" />
</div>
<div id="reset2" class="reset step slide" data-x="-4300" data-y="400" data-scale="0.4" data-rotate="0">
<q>Edit file</q>
<img src="ex5.png" />
</div>
<div id="reset3" class="reset step slide" data-x="-4300" data-y="400" data-scale="0.4" data-rotate="0">
<q>Stage</q>
<img src="ex6.png" />
</div>
<div id="reset4" class="reset step slide" data-x="-4300" data-y="400" data-scale="0.4" data-rotate="0">
<q>Commit</q>
<img src="ex7.png" />
</div>
<div id="reset5" class="reset step slide" data-x="-4700" data-y="400" data-scale="0.4" data-rotate="0">
<q>git reset --soft</q>
<img src="reset-soft.png" />
</div>
<div id="reset6" class="reset step slide" data-x="-4700" data-y="400" data-scale="0.4" data-rotate="0">
<q>git reset</q>
<img src="reset-mixed.png" />
</div>
<div id="reset7" class="reset step slide" data-x="-4700" data-y="400" data-scale="0.4" data-rotate="0">
<q>git reset --hard</q>
<img src="reset-hard.png" />
</div>
<div id="mercurial" class="step mercurial" data-x="-1550" data-y="2100" data-scale="1.8" data-rotate="180">
Mercurial - strengths and weaknesses
</div>
<div class="step imgslide mercurial" data-x="-740" data-y="1600" data-scale="0.4" data-rotate="180">
<q>
Key differences in commits structure:
<ul class="small">
<li>anonymous heads (no branch pointers)</li>
<li>named branches</li>
<li>no octopus merge</li>
</ul>
</q>
<img src="hg-repo-commits.png" />
</div>
<div class="step imgslide mercurial" data-x="-1150" data-y="1600" data-scale="0.4" data-rotate="180">
<q>
<ul class="small">
<li>flat manifest file</li>
<li>manifest entry points to a revision in revlog</li>
<li>revlog stores all file's revision</li>
<li>revlog's index shows revision's length and offset</li>
</ul>
</q>
<img src="hg-changeset-internal.png" />
</div>
<div class="step slide mercurial" data-x="-1560" data-y="1600" data-scale="0.4" data-rotate="180">
<q>
In Mercurial each file is stored in a single revlog file (+index file).<br/>
Building file revision - log(1):
<ul>
<li>finding a revision info in index</li>
<li>reading length and offset in revlog</li>
<li>adding up a few deltas</li>
</ul>
</q>
</div>
<div class="step slide mercurial" data-x="-1970" data-y="1600" data-scale="0.4" data-rotate="180">
<q>
- A changeset and revlog entry is identified by a SHA-1 string (called nodeid).
Revlogs are append only.
<br/>
- Basic history edition - hg rollback undoes last operation (i.e. commit or pull).
This cannot be undone...
<br/>
- hg commit --amend since mid-2012
</q>
</div>
<div id="localRevId" class="step slide mercurial" data-x="-1970" data-y="1270" data-scale="0.4" data-rotate="180">
<q>
Apart from global SHA-1 nodeid, each changeset has a sequential local revision id.
This does <strong>not</strong> propagate cross-repo and can be different for each user...
</q>
</div>
<div id="wtf2" class="step" data-x="-1510" data-y="-140" data-rotate="90" data-scale="3.2">
</div>
<div id="mqExt" class="step slide mercurial" data-x="-1560" data-y="1270" data-scale="0.4" data-rotate="180">
<q>
MQ extension: index and "history edit":
<ul class="medium">
<li>adds index-like feature</li>
<li>many queues support for storing patches</li>
<li>allows for patches versioning</li>
<li>until patch in queue is commited you can edit, rearrange etc.</li>
</ul>
</q>
</div>
<div id="mercurialPros" class="step slide mercurial" data-x="-1150" data-y="1270" data-scale="0.4" data-rotate="180">
<q>
<ul>
<li>commands have less switches - clearer doc</li>
<li>tutorials sub-par comparing to the free git-book</li>
<li>documetnation and tutorials for plugins / extensions has low quality</li>
</ul>
</q>
</div>
<div id="qna" class="step" data-x="600" data-y="1000" data-scale="2">
<p>Q & A</p>
</div>
<div id="thanks" class="step" data-x="700" data-y="2300" data-scale="2">
<p>Thanks!</p>
</div>
<div id="overview" class="step" data-x="-1500" data-y="-500" data-scale="8">
</div>
<div id="impressjsslide" class="step" data-x="1500" data-y="8000" data-scale="50">
<p id="madewith">Made with <div id="impressjslink"><a href="https://github.com/bartaz/impress.js">impress.js!</a></div></p>
<p class="kudos">Kudos to <a href="http://bartaz.github.com/">bartaz (Bartek Szopka)</a> for creating it!</p>
</div>
</div>
<script src="impress.js"></script>
<script>
impress().init();
</script>
</body>
</html>