Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: docs/man7/depot_tools_tutorial.7

Issue 225433003: Add a basic tutorial for the tools in depot_tools. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@git_map
Patch Set: pylint Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « docs/man7/depot_tools.7 ('k') | docs/src/.gitignore » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 '\" t
2 .\" Title: depot_tools_tutorial
3 .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
5 .\" Date: 04/10/2014
6 .\" Manual: Chromium depot_tools Manual
7 .\" Source: depot_tools bec7be9
8 .\" Language: English
9 .\"
10 .TH "DEPOT_TOOLS_TUTORIAL" "7" "04/10/2014" "depot_tools bec7be9" "Chromium depo t_tools Manual"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 depot_tools_tutorial \- A tutorial introduction to the Chromium depot_tools git extensions\&.
32 .SH "DESCRIPTION"
33 .sp
34 The Chromium \fBdepot_tools\fR(7) suite contains many git workflow\-enhancing to ols which are designed to work together to enable anyone to wrangle the Chromium codebase expertly\&. This tutorial explains how to do development on Chromium u sing these tools\&. This will cover:
35 .sp
36 .RS 4
37 .ie n \{\
38 \h'-04'\(bu\h'+03'\c
39 .\}
40 .el \{\
41 .sp -1
42 .IP \(bu 2.3
43 .\}
44 Setting up
45 .RE
46 .sp
47 .RS 4
48 .ie n \{\
49 \h'-04'\(bu\h'+03'\c
50 .\}
51 .el \{\
52 .sp -1
53 .IP \(bu 2.3
54 .\}
55 Getting the code
56 .RE
57 .sp
58 .RS 4
59 .ie n \{\
60 \h'-04'\(bu\h'+03'\c
61 .\}
62 .el \{\
63 .sp -1
64 .IP \(bu 2.3
65 .\}
66 TL;DR Walkthrough
67 .RE
68 .sp
69 .RS 4
70 .ie n \{\
71 \h'-04'\(bu\h'+03'\c
72 .\}
73 .el \{\
74 .sp -1
75 .IP \(bu 2.3
76 .\}
77 Creating / Uploading a CL
78 .RE
79 .sp
80 .RS 4
81 .ie n \{\
82 \h'-04'\(bu\h'+03'\c
83 .\}
84 .el \{\
85 .sp -1
86 .IP \(bu 2.3
87 .\}
88 Updating the code
89 .RE
90 .sp
91 .RS 4
92 .ie n \{\
93 \h'-04'\(bu\h'+03'\c
94 .\}
95 .el \{\
96 .sp -1
97 .IP \(bu 2.3
98 .\}
99 Managing multiple CLs
100 .RE
101 .sp
102 .RS 4
103 .ie n \{\
104 \h'-04'\(bu\h'+03'\c
105 .\}
106 .el \{\
107 .sp -1
108 .IP \(bu 2.3
109 .\}
110 Managing dependent CLs
111 .RE
112 .sp
113 Please refer to the manpages (or \-\-help output) for details about any of the c ommands mentioned in this tutorial\&.
114 .if n \{\
115 .sp
116 .\}
117 .RS 4
118 .it 1 an-trap
119 .nr an-no-space-flag 1
120 .nr an-break-flag 1
121 .br
122 .ps +1
123 \fBNote\fR
124 .ps -1
125 .br
126 .sp
127 If your platform does not support manpages (or you prefer something a bit more e xpressive than plain text) you can find all documentation in \fIhtml\fR form in the [DEPOT_TOOLS]/docs/html folder\&.
128 .sp .5v
129 .RE
130 .SS "PREREQUISITES"
131 .sp
132 This tutorial assumes basic familiarity with git terminology and concepts\&. If you need to brush up on these, the following are very good resources:
133 .sp
134 .RS 4
135 .ie n \{\
136 \h'-04'\(bu\h'+03'\c
137 .\}
138 .el \{\
139 .sp -1
140 .IP \(bu 2.3
141 .\}
142 \m[blue]\fBThink like (a) Git\fR\m[]\&\s-2\u[1]\d\s+2
143 \- A lighthearted overview of git\&. If you\(cqre sorta\-familiar with git, but not
144 \fIcomfortable\fR
145 with it, then give this a look\&.
146 .RE
147 .sp
148 .RS 4
149 .ie n \{\
150 \h'-04'\(bu\h'+03'\c
151 .\}
152 .el \{\
153 .sp -1
154 .IP \(bu 2.3
155 .\}
156 \m[blue]\fBGit Immersion Tutorial\fR\m[]\&\s-2\u[2]\d\s+2
157 \- An in\-depth git tutorial\&.
158 .RE
159 .sp
160 .RS 4
161 .ie n \{\
162 \h'-04'\(bu\h'+03'\c
163 .\}
164 .el \{\
165 .sp -1
166 .IP \(bu 2.3
167 .\}
168 \m[blue]\fBpcottle\(cqs Visual Git Branching\fR\m[]\&\s-2\u[3]\d\s+2
169 \- An excellent interactive/graphical demo on how git handles commits, branches, and shows the operations git performs on them\&.
170 .RE
171 .sp
172 .RS 4
173 .ie n \{\
174 \h'-04'\(bu\h'+03'\c
175 .\}
176 .el \{\
177 .sp -1
178 .IP \(bu 2.3
179 .\}
180 \m[blue]\fBPro Git book\fR\m[]\&\s-2\u[4]\d\s+2
181 \- \(lqThe\(rq book for learning git from basics to advanced concepts\&. A bit d ry, but very through\&.
182 .RE
183 .sp
184 If you\(cqve tried these out and are still having some trouble getting started, there are \fImany\fR other resources online which should help\&. If you\(cqre \f Ireally\fR \fB\fIreally\fR\fR stuck, then chat up one of the Chromium infrastruc ture team members for some pointers\&.
185 .PP
186 Litmus Test
187 .RS 4
188 If you know what
189 git add,
190 git status,
191 git commit
192 do and you know
193 \fIessentially\fR
194 what
195 git rebase
196 does, then you should know enough to follow along\&.
197 .RE
198 .SH "SETTING UP"
199 .SS "GET DEPOT TOOLS"
200 .sp
201 Clone the \fIdepot_tools\fR repository:
202 .sp
203 .if n \{\
204 .RS 4
205 .\}
206 .nf
207 \fB$ git clone https://chromium\&.googlesource\&.com/chromium/tools/depot_tools\ fR
208 .fi
209 .if n \{\
210 .RE
211 .\}
212 .sp
213 .sp
214 Add \fIdepot_tools\fR to the \fIend\fR of your PATH and MANPATH (you will probab ly want to put this in your ~/\&.bashrc or ~/\&.zshrc)\&. Assuming you cloned \f Idepot_tools\fR to /path/to/depot_tools:
215 .sp
216 .if n \{\
217 .RS 4
218 .\}
219 .nf
220 \fB$ export PATH=$PATH:/path/to/depot_tools\fR
221 \fB$ export MANPATH=$MANPATH:/path/to/depot_tools/docs\fR \fB(1)\fR
222 .fi
223 .if n \{\
224 .RE
225 .\}
226 .sp
227 .sp
228 \fB1. \fRObserve that this path is
229 depot_tools/\fBdocs\fR\&.
230 .br
231 .SS "BOOTSTRAPPING CONFIGURATION"
232 .sp
233 If you have never used git before, you\(cqll need to set some global git configu rations; substitute your name and email address in the following commands:
234 .sp
235 .if n \{\
236 .RS 4
237 .\}
238 .nf
239 \fB$ git config \-\-global user\&.name \(lqJohn Doe\(rq\fR
240 \fB$ git config \-\-global user\&.email \(lqjdoe@email\&.com\(rq\fR
241 \fB$ git config \-\-global core\&.autocrlf false\fR
242 \fB$ git config \-\-global core\&.filemode false\fR
243 \fB$\fR # and for fun!
244 \fB$ git config \-\-global color\&.ui true\fR
245 .fi
246 .if n \{\
247 .RE
248 .\}
249 .sp
250 .SH "GETTING THE CODE"
251 .sp
252 Pick an empty directory and run one of the following:
253 .sp
254 .if n \{\
255 .RS 4
256 .\}
257 .nf
258 \fB$ fetch chromium\fR # Basic checkout for desktop Chromium
259 \fB$ fetch blink\fR # Chromium code with Blink checked out to tip\-of\-tree
260 \fB$ fetch android\fR # Chromium checkout for Android platform
261 \fB$ fetch ios\fR # Chromium checkout for iOS platform
262 .fi
263 .if n \{\
264 .RE
265 .\}
266 .sp
267 .sp
268 When the fetch tool completes you should have the following in your working dire ctory:
269 .sp
270 .if n \{\
271 .RS 4
272 .\}
273 .nf
274 \fB\&.gclient\fR # A configuration file for you source checkout
275 \fBsrc/\fR # Top\-level Chromium source checkout\&.
276 .fi
277 .if n \{\
278 .RE
279 .\}
280 .sp
281 .sp
282 If you are on linux, then you\(cqll need to run:
283 .sp
284 .if n \{\
285 .RS 4
286 .\}
287 .nf
288 \fB$ cd src && \&./build/install\-build\-deps\&.sh\fR
289 .fi
290 .if n \{\
291 .RE
292 .\}
293 .sp
294 .sp
295 And finally:
296 .sp
297 .if n \{\
298 .RS 4
299 .\}
300 .nf
301 \fB$ gclient sync\fR \fB(1)\fR
302 .fi
303 .if n \{\
304 .RE
305 .\}
306 .sp
307 .sp
308 \fB1. \fRThis will pull all dependencies of the Chromium src checkout\&. You wil l need to run this any time you update the main src checkout\&.
309 .br
310 .SH "TL;DR WALKTHROUGH"
311 .sp
312 This section will demo what a typical workflow looks like when writing, updating , and committing multiple CLs\&.
313 .sp
314
315 .sp
316 .if n \{\
317 .RS 4
318 .\}
319 .nf
320 \fB$ fetch chromium\fR
321 \&.\&.\&. truncated output \&.\&.\&.
322 \fB$ cd src\fR
323 .fi
324 .if n \{\
325 .RE
326 .\}
327 .sp
328 (only on linux)
329 .sp
330 .if n \{\
331 .RS 4
332 .\}
333 .nf
334 \fB$ \&./build/install\-build\-deps\&.sh\fR
335 \&.\&.\&. truncated output \&.\&.\&.
336 .fi
337 .if n \{\
338 .RE
339 .\}
340 .sp
341 Pull in all dependencies for HEAD
342 .sp
343 .if n \{\
344 .RS 4
345 .\}
346 .nf
347 \fB$ gclient sync\fR
348 \&.\&.\&. truncated output \&.\&.\&.
349 .fi
350 .if n \{\
351 .RE
352 .\}
353 .sp
354 Let\*(Aqs fix something!
355 .sp
356 .if n \{\
357 .RS 4
358 .\}
359 .nf
360 \fB$ git new\-branch fix_typo\fR
361 \fB$ echo \-e \*(Aq/Banana\ens/Banana/Kuun\enwq\*(Aq | ed build/whitespace_file\ &.txt\fR
362 1503
363 It was a Domo\-Banana\&.
364 It was a Domo\-Kuun\&.
365 1501
366 \fB$ git commit \-am \*(AqFix terrible typo\&.\*(Aq\fR
367 [fix_typo 615ffa7] Fix terrible typo\&.
368 1 file changed, 1 insertion(+), 1 deletion(\-)
369 \fB$ git map\fR
370 \fB* 615ffa7 \fR (\fBfix_typo\fR) 2014\-04\-10 ~ Fix terrible typo\&.
371 * \fBbeec6f4 \fR (origin/master, origin/HEAD) 2014\-04\-10 ~ Make ReflectorIm pl use mailboxes\fB <(fix_typo)\fR
372 * \fB41290e0 \fR 2014\-04\-10 ~ don\*(Aqt use glibc\-specific execinfo\&.h on uclibc builds
373 * \fBa76fde7 \fR 2014\-04\-10 ~ [fsp] Add requestUnmount() method together wi th the request manager\&.
374 * \fB9de7a71 \fR 2014\-04\-10 ~ linux_aura: Use system configuration for midd le clicking the titlebar\&.
375 * \fB073b0c2 \fR 2014\-04\-10 ~ ContentView\->ContentViewCore in ContentViewR enderView
376 * \fB2250f53 \fR 2014\-04\-10 ~ ozone: evdev: Filter devices by path
377 * \fB33a7a74 \fR 2014\-04\-10 ~ Always output seccomp error messages to stder r
378 \fB$ git status\fR
379 On branch fix_typo
380 Your branch is ahead of \*(Aqorigin/master\*(Aq by 1 commit\&.
381 (use "git push" to publish your local commits)
382
383 nothing to commit, working directory clean
384 \fB$ git cl upload \-r domo@chromium\&.org \-\-send\-mail\fR
385 \&.\&.\&. truncated output \&.\&.\&.
386 .fi
387 .if n \{\
388 .RE
389 .\}
390 .sp
391 While we wait for feedback, let\*(Aqs do something else\&.
392 .sp
393 .if n \{\
394 .RS 4
395 .\}
396 .nf
397 \fB$ git new\-branch chap2\fR
398 \fB$ git map\-branches\fR
399 \fBorigin/master
400 chap2 *
401 \fR fix_typo
402 \fB$ cat >> build/whitespace_file\&.txt <<EOF\fR
403
404 "You recall what happened on Mulholland drive?" The ceiling fan rotated slowly
405 overhead, barely disturbing the thick cigarette smoke\&. No doubt was left about
406 when the fan was last cleaned\&.
407 EOF
408 \fB$ git status\fR
409 On branch chap2
410 Your branch is up\-to\-date with \*(Aqorigin/master\*(Aq\&.
411
412 Changes not staged for commit:
413 (use "git add <file>\&.\&.\&." to update what will be committed)
414 (use "git checkout \-\- <file>\&.\&.\&." to discard changes in working directo ry)
415
416 modified: build/whitespace_file\&.txt
417
418 no changes added to commit (use "git add" and/or "git commit \-a")
419 .fi
420 .if n \{\
421 .RE
422 .\}
423 .sp
424 Someone on the code review pointed out that our typo\-fix has a typo :( We\*(Aqr e still working on \*(Aqchap2\*(Aq but we really want to land \*(Aqfix_typo\*(Aq , so let\*(Aqs switch over and fix it\&.
425 .sp
426 .if n \{\
427 .RS 4
428 .\}
429 .nf
430 \fB$ git freeze\fR
431 \fB$ git checkout fix_typo\fR
432 Switched to branch \*(Aqfix_typo\*(Aq
433 Your branch is ahead of \*(Aqorigin/master\*(Aq by 1 commit\&.
434 (use "git push" to publish your local commits)
435 \fB$ echo \-e \*(Aq/Kuun\ens/Kuun/Kun\enwq\*(Aq | ed build/whitespace_file\&.txt \fR
436 1501
437 It was a Domo\-Kuun\&.
438 It was a Domo\-Kun\&.
439 1500
440 \fB$ git upstream\-diff \-\-wordwise\fR
441 \fBdiff \-\-git a/build/whitespace_file\&.txt b/build/whitespace_file\&.txt\fR
442 \fBindex 3eba355\&.\&.57cdcee 100644\fR
443 \fB\-\-\- a/build/whitespace_file\&.txt\fR
444 \fB+++ b/build/whitespace_file\&.txt\fR
445 @@ \-17,7 +17,7 @@ swept up the streets (for it is in London that our scene lies ), rattling along
446 the housetops, and fiercely agitating the scanty flame of the lamps that
447 struggled against the elements\&. A hooded figure emerged\&.
448
449 It was a Domo\-BananaKun\&.
450
451 "What took you so long?", inquired his wife\&.
452
453 \fB$ git commit \-am \*(AqFix typo for good!\*(Aq\fR
454 [fix_typo 2c0ad9c] Fix typo for good!
455 1 file changed, 1 insertion(+), 1 deletion(\-)
456 \fB$ git cl upload\fR
457 \&.\&.\&. truncated output \&.\&.\&.
458 .fi
459 .if n \{\
460 .RE
461 .\}
462 .sp
463 Since we got lgtm, let the CQ land it\&.
464 .sp
465 .if n \{\
466 .RS 4
467 .\}
468 .nf
469 \fB$ git cl set_commit\fR
470 \fB$ git map\fR
471 * \fB0e2e52e \fR (\fBchap2\fR) 2014\-04\-10 ~ FREEZE\&.unindexed
472 | \fB* 2c0ad9c \fR (\fBfix_typo\fR) 2014\-04\-10 ~ Fix typo for good!
473 | * \fB615ffa7 \fR 2014\-04\-10 ~ Fix terrible typo\&.
474 |/
475 * \fBbeec6f4 \fR (origin/master, origin/HEAD) 2014\-04\-10 ~ Make ReflectorIm pl use mailboxes\fB <(chap2, fix_typo)\fR
476 * \fB41290e0 \fR 2014\-04\-10 ~ don\*(Aqt use glibc\-specific execinfo\&.h on uclibc builds
477 * \fBa76fde7 \fR 2014\-04\-10 ~ [fsp] Add requestUnmount() method together wi th the request manager\&.
478 * \fB9de7a71 \fR 2014\-04\-10 ~ linux_aura: Use system configuration for midd le clicking the titlebar\&.
479 * \fB073b0c2 \fR 2014\-04\-10 ~ ContentView\->ContentViewCore in ContentViewR enderView
480 * \fB2250f53 \fR 2014\-04\-10 ~ ozone: evdev: Filter devices by path
481 * \fB33a7a74 \fR 2014\-04\-10 ~ Always output seccomp error messages to stder r
482 .fi
483 .if n \{\
484 .RE
485 .\}
486 .sp
487 Switch back to where we were using the nav* commands (for fun\&.\&.\&. git check out would work here too)
488 .sp
489 .if n \{\
490 .RS 4
491 .\}
492 .nf
493 \fB$ git map\-branches\fR
494 origin/master
495 chap2
496 \fB fix_typo *
497 $ git nav\-upstream\fR
498 Note: checking out \*(Aqorigin/master\*(Aq\&.
499
500 You are in \*(Aqdetached HEAD\*(Aq state\&. You can look around, make experiment al
501 changes and commit them, and you can discard any commits you make in this
502 state without impacting any branches by performing another checkout\&.
503
504 If you want to create a new branch to retain commits you create, you may
505 do so (now or later) by using \-b with the checkout command again\&. Example:
506
507 git checkout \-b new_branch_name
508
509 HEAD is now at beec6f4\&.\&.\&. Make ReflectorImpl use mailboxes
510 \fB$ git nav\-downstream\fR
511 Please select a downstream branch
512 0\&. chap2
513 1\&. fix_typo
514 Selection (0\-1)[0]: 0
515 Previous HEAD position was beec6f4\&.\&.\&. Make ReflectorImpl use mailboxes
516 Switched to branch \*(Aqchap2\*(Aq
517 Your branch is ahead of \*(Aqorigin/master\*(Aq by 1 commit\&.
518 (use "git push" to publish your local commits)
519 \fB$ git map\-branches\fR
520 origin/master
521 \fB chap2 *
522 \fR fix_typo
523 .fi
524 .if n \{\
525 .RE
526 .\}
527 .sp
528 Now we can pick up on chapter2 where we left off\&.
529 .sp
530 .if n \{\
531 .RS 4
532 .\}
533 .nf
534 \fB$ git thaw\fR
535 \fB$ git diff\fR
536 \fBdiff \-\-git a/build/whitespace_file\&.txt b/build/whitespace_file\&.txt\fR
537 \fBindex 3eba355\&.\&.9d08d9d 100644\fR
538 \fB\-\-\- a/build/whitespace_file\&.txt\fR
539 \fB+++ b/build/whitespace_file\&.txt\fR
540 @@ \-34,3 +34,7 @@ with his fork, watching the runny jelly spread and pool acros s his plate,
541 like the blood of a dying fawn\&. \e"It reminds me of that time \-\-\e" he star ted, as
542 his wife cut in quickly: \e"\-\- please\&. I can\*(Aqt bear to hear it\&.\e"\&. A flury of
543 images coming from the past flowed through his mind\&.
544 +
545 +"You recall what happened on Mulholland drive?" The ceiling fan rotated slowly
546 +overhead, barely disturbing the thick cigarette smoke\&. No doubt was left abou t
547 +when the fan was last cleaned\&.
548 \fB$ cat >> build/whitespace_file\&.txt <<EOF\fR
549
550 There was an poignant pause\&.
551 EOF
552 \fB$ git diff\fR
553 \fBdiff \-\-git a/build/whitespace_file\&.txt b/build/whitespace_file\&.txt\fR
554 \fBindex 3eba355\&.\&.e3a55de 100644\fR
555 \fB\-\-\- a/build/whitespace_file\&.txt\fR
556 \fB+++ b/build/whitespace_file\&.txt\fR
557 @@ \-34,3 +34,9 @@ with his fork, watching the runny jelly spread and pool acros s his plate,
558 like the blood of a dying fawn\&. \e"It reminds me of that time \-\-\e" he star ted, as
559 his wife cut in quickly: \e"\-\- please\&. I can\*(Aqt bear to hear it\&.\e"\&. A flury of
560 images coming from the past flowed through his mind\&.
561 +
562 +"You recall what happened on Mulholland drive?" The ceiling fan rotated slowly
563 +overhead, barely disturbing the thick cigarette smoke\&. No doubt was left abou t
564 +when the fan was last cleaned\&.
565 +
566 +There was an poignant pause\&.
567 \fB$ git commit \-am \*(AqFinish chapter 2\*(Aq\fR
568 [chap2 ceef712] Finish chapter 2
569 1 file changed, 6 insertions(+)
570 \fB$ git map\fR
571 \fB* ceef712 \fR (\fBchap2\fR) 2014\-04\-10 ~ Finish chapter 2
572 | * \fB2c0ad9c \fR (\fBfix_typo\fR) 2014\-04\-10 ~ Fix typo for good!
573 | * \fB615ffa7 \fR 2014\-04\-10 ~ Fix terrible typo\&.
574 |/
575 * \fBbeec6f4 \fR (origin/master, origin/HEAD) 2014\-04\-10 ~ Make ReflectorIm pl use mailboxes\fB <(chap2, fix_typo)\fR
576 * \fB41290e0 \fR 2014\-04\-10 ~ don\*(Aqt use glibc\-specific execinfo\&.h on uclibc builds
577 * \fBa76fde7 \fR 2014\-04\-10 ~ [fsp] Add requestUnmount() method together wi th the request manager\&.
578 * \fB9de7a71 \fR 2014\-04\-10 ~ linux_aura: Use system configuration for midd le clicking the titlebar\&.
579 * \fB073b0c2 \fR 2014\-04\-10 ~ ContentView\->ContentViewCore in ContentViewR enderView
580 * \fB2250f53 \fR 2014\-04\-10 ~ ozone: evdev: Filter devices by path
581 * \fB33a7a74 \fR 2014\-04\-10 ~ Always output seccomp error messages to stder r
582 \fB$ git cl upload \-r domo@chromium\&.org \-\-send\-mail\fR
583 \&.\&.\&. truncated output \&.\&.\&.
584 .fi
585 .if n \{\
586 .RE
587 .\}
588 .sp
589 We poke a committer until they lgtm :)
590 .sp
591 .if n \{\
592 .RS 4
593 .\}
594 .nf
595 \fB$ git cl set_commit\fR
596 .fi
597 .if n \{\
598 .RE
599 .\}
600 .sp
601 While that runs through the CQ, let\*(Aqs get started on chapter 3\&. Since we k now that chapter 3 depends on chapter 2, we\*(Aqll track the current chapter2 br anch\&.
602 .sp
603 .if n \{\
604 .RS 4
605 .\}
606 .nf
607 \fB$ git new\-branch \-\-upstream_current chap3\fR
608 \fB$ cat >> build/whitespace_file\&.txt <<EOF\fR
609
610 CHAPTER 3:
611 Mr\&. Usagi felt that something wasn\*(Aqt right\&. Shortly after the Domo\-Kun left he
612 began feeling sick\&.
613 EOF
614 \fB$ git commit \-am \*(Aqbeginning of chapter 3\*(Aq\fR
615 [chap3 7d4238a] beginning of chapter 3
616 1 file changed, 4 insertions(+)
617 \fB$ git map\fR
618 \fB* 7d4238a \fR (\fBchap3\fR) 2014\-04\-10 ~ beginning of chapter 3
619 * \fBceef712 \fR (\fBchap2\fR) 2014\-04\-10 ~ Finish chapter 2\fB <(chap3) \fR
620 | * \fB2c0ad9c \fR (\fBfix_typo\fR) 2014\-04\-10 ~ Fix typo for good!
621 | * \fB615ffa7 \fR 2014\-04\-10 ~ Fix terrible typo\&.
622 |/
623 * \fBbeec6f4 \fR (origin/master, origin/HEAD) 2014\-04\-10 ~ Make ReflectorIm pl use mailboxes\fB <(chap2, fix_typo)\fR
624 * \fB41290e0 \fR 2014\-04\-10 ~ don\*(Aqt use glibc\-specific execinfo\&.h on uclibc builds
625 * \fBa76fde7 \fR 2014\-04\-10 ~ [fsp] Add requestUnmount() method together wi th the request manager\&.
626 * \fB9de7a71 \fR 2014\-04\-10 ~ linux_aura: Use system configuration for midd le clicking the titlebar\&.
627 * \fB073b0c2 \fR 2014\-04\-10 ~ ContentView\->ContentViewCore in ContentViewR enderView
628 * \fB2250f53 \fR 2014\-04\-10 ~ ozone: evdev: Filter devices by path
629 * \fB33a7a74 \fR 2014\-04\-10 ~ Always output seccomp error messages to stder r
630 .fi
631 .if n \{\
632 .RE
633 .\}
634 .sp
635 We haven\*(Aqt updated the code in a while, so let\*(Aqs do that now\&.
636 .sp
637 .if n \{\
638 .RS 4
639 .\}
640 .nf
641 \fB$ git rebase\-update\fR
642 Fetching origin
643 From /Users/iannucci/chromium/depot_tools/docs/src/demo_repo
644 beec6f4\&.\&.59cdb73 master \-> origin/master
645 Rebasing: chap2
646 Rebasing: fix_typo
647 Failed! Attempting to squash fix_typo \&.\&.\&. Success!
648 Rebasing: chap3
649 Deleted branch fix_typo (was 5d26fec)\&.
650 Reparented chap3 to track origin/master (was tracking chap2)
651 Deleted branch chap2 (was 5d26fec)\&.
652 .fi
653 .if n \{\
654 .RE
655 .\}
656 .sp
657 Well look at that\&. The CQ landed our typo and chapter2 branches already and gi t rebase\-update cleaned them up for us\&.
658 .sp
659 .if n \{\
660 .RS 4
661 .\}
662 .nf
663 \fB$ gclient sync\fR
664 \&.\&.\&. truncated output \&.\&.\&.
665 \fB$ git map\fR
666 \fB* 93fe917 \fR (\fBchap3\fR) 2014\-04\-10 ~ beginning of chapter 3
667 * \fB5d26fec \fR (origin/master, origin/HEAD) 2014\-04\-10 ~ Finish chapter 2 \fB <(chap3)\fR
668 * \fBdf7fefb \fR 2014\-04\-10 ~ Revert 255617, due to it not tracking use of the link doctor page properly\&.
669 * \fB4b39cda \fR 2014\-04\-10 ~ Fix terrible typo\&.
670 * \fB248c5b6 \fR 2014\-04\-10 ~ Temporarily CHECK(trial) in ChromeRenderProce ssObserver::OnSetFieldTrialGroup\&.
671 * \fB8171df8 \fR 2014\-04\-10 ~ Remove AMD family check for the flapper crypt o accelerator\&.
672 * \fBd6a30d2 \fR 2014\-04\-10 ~ Change the Pica load benchmark to listen for the polymer\-ready event
673 * \fBbeec6f4 \fR 2014\-04\-10 ~ Make ReflectorImpl use mailboxes
674 * \fB41290e0 \fR 2014\-04\-10 ~ don\*(Aqt use glibc\-specific execinfo\&.h on uclibc builds
675 * \fBa76fde7 \fR 2014\-04\-10 ~ [fsp] Add requestUnmount() method together wi th the request manager\&.
676 * \fB9de7a71 \fR 2014\-04\-10 ~ linux_aura: Use system configuration for midd le clicking the titlebar\&.
677 * \fB073b0c2 \fR 2014\-04\-10 ~ ContentView\->ContentViewCore in ContentViewR enderView
678 * \fB2250f53 \fR 2014\-04\-10 ~ ozone: evdev: Filter devices by path
679 * \fB33a7a74 \fR 2014\-04\-10 ~ Always output seccomp error messages to stder r
680 .fi
681 .if n \{\
682 .RE
683 .\}
684 .sp
685 Someone on IRC mentions that they actually landed a chapter 3 already! We should pull their changes before continuing\&. Brace for a code conflict!
686 .sp
687 .if n \{\
688 .RS 4
689 .\}
690 .nf
691 \fB$ git rebase\-update\fR
692 Fetching origin
693 From /Users/iannucci/chromium/depot_tools/docs/src/demo_repo
694 5d26fec\&.\&.59cdb73 master \-> origin/master
695 Rebasing: chap2
696 \&.\&.\&. lots of output, it\*(Aqs a conflict alright :(\&.\&.\&.
697 \fB$ git diff\fR
698 \fBdiff \-\-cc build/whitespace_file\&.txt\fR
699 \fBindex 1293282,f903ea2\&.\&.0000000\fR
700 \fB\-\-\- a/build/whitespace_file\&.txt\fR
701 \fB+++ b/build/whitespace_file\&.txt\fR
702 @@@ \-42,4 \-42,5 +42,9 @@@ when the fan was last cleaned
703 There was an poignant pause\&.
704
705 CHAPTER 3:
706 ++<<<<<<< HEAD
707 +Hilariousness! This chapter is awesome!
708 ++=======
709 + Mr\&. Usagi felt that something wasn\*(Aqt right\&. Shortly after the Domo\-Ku n left he
710 + began feeling sick\&.
711 ++>>>>>>> beginning of chapter 3
712 .fi
713 .if n \{\
714 .RE
715 .\}
716 .sp
717 Oh, well, that\*(Aqs not too bad\&. In fact\&.\&.\&. that\*(Aqs a terrible chapt er 3!
718 .sp
719 .if n \{\
720 .RS 4
721 .\}
722 .nf
723 \fB$ $EDITOR build/whitespace_file\&.txt\fR
724 \&.\&.\&. /me deletes bad chapter 3 \&.\&.\&.
725 \fB$ git add build/whitespace_file\&.txt\fR
726 \fB$ git diff \-\-cached\fR
727 \fBdiff \-\-git a/build/whitespace_file\&.txt b/build/whitespace_file\&.txt\fR
728 \fBindex 1293282\&.\&.f903ea2 100644\fR
729 \fB\-\-\- a/build/whitespace_file\&.txt\fR
730 \fB+++ b/build/whitespace_file\&.txt\fR
731 @@ \-42,4 +42,5 @@ when the fan was last cleaned\&.
732 There was an poignant pause\&.
733
734 CHAPTER 3:
735 \-Hilariousness! This chapter is awesome!
736 +Mr\&. Usagi felt that something wasn\*(Aqt right\&. Shortly after the Domo\-Kun left he
737 +began feeling sick\&.
738 .fi
739 .if n \{\
740 .RE
741 .\}
742 .sp
743 Much better
744 .sp
745 .if n \{\
746 .RS 4
747 .\}
748 .nf
749 \fB$ git rebase \-\-continue\fR
750 Applying: beginning of chapter 3
751 \fB$ git rebase\-update\fR
752 Fetching origin
753 chap3 up\-to\-date
754 \fB$ gclient sync\fR
755 \&.\&.\&. truncated output \&.\&.\&.
756 \fB$ git map\fR
757 \fB* 1cb4f5b \fR (\fBchap3\fR) 2014\-04\-10 ~ beginning of chapter 3
758 * \fB59cdb73 \fR (origin/master, origin/HEAD) 2014\-04\-10 ~ Refactor data in terchange format\&.\fB <(chap3)\fR
759 * \fB34676a3 \fR 2014\-04\-10 ~ Ensure FS is exited for all not\-in\-same\-pa ge navigations\&.
760 * \fB7d4784e \fR 2014\-04\-10 ~ Add best chapter2 ever!
761 * \fB5d26fec \fR 2014\-04\-10 ~ Finish chapter 2
762 * \fBdf7fefb \fR 2014\-04\-10 ~ Revert 255617, due to it not tracking use of the link doctor page properly\&.
763 * \fB4b39cda \fR 2014\-04\-10 ~ Fix terrible typo\&.
764 * \fB248c5b6 \fR 2014\-04\-10 ~ Temporarily CHECK(trial) in ChromeRenderProce ssObserver::OnSetFieldTrialGroup\&.
765 * \fB8171df8 \fR 2014\-04\-10 ~ Remove AMD family check for the flapper crypt o accelerator\&.
766 * \fBd6a30d2 \fR 2014\-04\-10 ~ Change the Pica load benchmark to listen for the polymer\-ready event
767 * \fBbeec6f4 \fR 2014\-04\-10 ~ Make ReflectorImpl use mailboxes
768 * \fB41290e0 \fR 2014\-04\-10 ~ don\*(Aqt use glibc\-specific execinfo\&.h on uclibc builds
769 * \fBa76fde7 \fR 2014\-04\-10 ~ [fsp] Add requestUnmount() method together wi th the request manager\&.
770 * \fB9de7a71 \fR 2014\-04\-10 ~ linux_aura: Use system configuration for midd le clicking the titlebar\&.
771 * \fB073b0c2 \fR 2014\-04\-10 ~ ContentView\->ContentViewCore in ContentViewR enderView
772 * \fB2250f53 \fR 2014\-04\-10 ~ ozone: evdev: Filter devices by path
773 * \fB33a7a74 \fR 2014\-04\-10 ~ Always output seccomp error messages to stder r
774 \fB$ git cl upload\fR
775 \&.\&.\&. truncated output \&.\&.\&.
776 .fi
777 .if n \{\
778 .RE
779 .\}
780 .sp
781 .sp
782 So there you have the basic flow\&. Note that you don\(cqt \fIhave\fR to do chro mium development using these tools\&. Any git workflow is compatible, as long as git cl upload is able to upload good patches\&.
783 .SH "CREATING / UPLOADING A CL"
784 .if n \{\
785 .sp
786 .\}
787 .RS 4
788 .it 1 an-trap
789 .nr an-no-space-flag 1
790 .nr an-break-flag 1
791 .br
792 .ps +1
793 \fBNote\fR
794 .ps -1
795 .br
796 .sp
797 The remainder of the tutorial assumes that your current working directory is the src/ folder mentioned in Getting the code\&.
798 .sp .5v
799 .RE
800 .sp
801 Each CL corresponds exactly with a single branch in git\&. Any time you want to begin a new CL, just:
802 .sp
803 .if n \{\
804 .RS 4
805 .\}
806 .nf
807 \fB$ git new\-branch <branch_name>\fR
808 .fi
809 .if n \{\
810 .RE
811 .\}
812 .sp
813 .sp
814 This will create and checkout a new branch named branch_name which will track th e default upstream (which is origin/master)\&. See \fBgit-new-branch\fR(1) for m ore features, such as the ability to track \fILKGR\fR\&.
815 .sp
816 Commit as many changes as you like to this branch\&. When you want to upload it for review, run:
817 .sp
818 .if n \{\
819 .RS 4
820 .\}
821 .nf
822 \fB$ git cl upload\fR
823 .fi
824 .if n \{\
825 .RE
826 .\}
827 .sp
828 .sp
829 This will take the diff of your branch against its upstream (origin/master), and will post it to the \m[blue]\fBChromium code review site\fR\m[]\&\s-2\u[5]\d\s+ 2\&.
830 .SH "UPDATING THE CODE"
831 .sp
832 Inevitably, you\(cqll want to pull in changes from the main Chromium repo\&. Thi s is pretty easy with \fIdepot_tools\fR:
833 .sp
834 .if n \{\
835 .RS 4
836 .\}
837 .nf
838 \fB$ git rebase\-update\fR
839 .fi
840 .if n \{\
841 .RE
842 .\}
843 .sp
844 .sp
845 This command will update all of your CLs to contain the latest code from their u pstreams\&. It will also automatically clean up CLs which have been committed an d a couple other nice things\&. See \fBgit-rebase-update\fR(1) for the full scoo p\&.
846 .sp
847 One thing to look out for are \fImerge conflicts\fR\&. These happen for exactly the same as they do with SVN, but the experience is a little more controllable w ith git\&. git rebase\-update will try to rebase all your branches for you, but if it encounters a merge conflict in one, it will halt and leave you in a rebase conflict state (see \fBgit-rebase\fR(1))\&. Resolving git rebase merge conflict s is beyond the scope of this tutorial, but there are many good sources online ( see the Prerequisites for some)\&.
848 .sp
849 Sometimes you\(cqre pretty certain that you\(cqve committed a certain branch, bu t git rebase\-update isn\(cqt able to tell that for sure\&. This is usually beca use your branch doesn\(cqt rebase cleanly\&. You could just delete the branch wi th git branch \-D <branch>, but you\(cqd like to double check the diff of your b ranch against its upstream before deleting it\&. If this is the case you can abo rt the rebase started by git rebase\-update, and then run \fBgit-squash-branch\f R(1) to flatten your branch into a single commit\&. When you run git rebase\-upd ate again, you\(cqll get a (hopefully) much smaller / saner diff\&. If it turns out you were wrong about your branch being fully committed, you can use \fBgit-r eflog\fR(1) to reset your branch back to where it was before\&. If the diff look s inconsequential, you can use git rebase \-\-skip to ignore it, and then git re base\-update will clean it up for you\&.
850 .sp
851 Once you\(cqre done resolving all of the merge conflict, just run git rebase\-up date, and it will pick up where it left off\&. Once the command has finished upd ating all of your branches, it will return you back to the branch you started on \&.
852 .if n \{\
853 .sp
854 .\}
855 .RS 4
856 .it 1 an-trap
857 .nr an-no-space-flag 1
858 .nr an-break-flag 1
859 .br
860 .ps +1
861 \fBNote\fR
862 .ps -1
863 .br
864 .sp
865 Running git rebase\-update will update all your branches, but it will not automa tically run gclient sync to update your dependencies\&.
866 .sp .5v
867 .RE
868 .SH "MANAGING MULTIPLE CLS"
869 .sp
870 Sometimes you want to work on more than one CL at once (say, you have a CL poste d for review and want to work on something else)\&. For each CL that you want to work on, just use git new\-branch <branchname>\&.
871 .sp
872 Once you start to have more than one CL at a time, it can be easy to lose your b earings\&. Fortunately, \fIdepot_tools\fR has two tools to help you out:
873 .sp
874 .if n \{\
875 .RS 4
876 .\}
877 .nf
878 \fB$ git map\fR
879 *\:\fB 7dcfe47 \fR (\:\fBfrozen_changes\fR\:) 2014\-03\-12 ~ FREEZE\&.unin dexed
880 * \fB4b0c180\fR 2014\-03\-12 ~ modfile
881 * \fB59a7cca\fR 2014\-03\-12 ~ a deleted file
882 * \fB6bec695\fR (\:origin/master\:) 2014\-03\-11 ~ Add neat feature \f B<(frozen_changes)\fR
883 * \fBd15a38a\fR 2014\-03\-11 ~ Epic README update
884 * \fBd559894\fR (\:\fBmaster\fR\:) 2014\-03\-11 ~ Important upstream chan ge
885 | * \fB9c311fd\fR (\:\fBcool_feature\fR\:) 2014\-03\-11 ~ Respond to CL com ments
886 | | * \fB2a1eeb2\fR (\:\fBsubfeature\fR\:) 2014\-03\-11 ~ integrate with Cool Service
887 | | * \fBd777af6\fR 2014\-03\-11 ~ slick commenting action
888 | |/
889 | * \fB265803a\fR 2014\-03\-11 ~ another improvement \fB<(subfeature)\fR
890 | * \fB6d831ac\fR (\:\fBspleen_tag\fR\:) 2014\-03\-11 ~ Refactor spleen
891 | * \fB82e74ab\fR 2014\-03\-11 ~ Add widget
892 |/
893 * \fBd08c5b3\fR (\:\fBbogus_noparent\fR\:) 2014\-03\-11 ~ Wonderful begin nings \fB<(cool_feature)\fR
894 .fi
895 .if n \{\
896 .RE
897 .\}
898 .sp
899 .sp
900 Note that this example repo is in dire need of a \fBgit-rebase-update\fR(1)!
901 .sp
902 .if n \{\
903 .RS 4
904 .\}
905 .nf
906 \fB$ git map\-branches\fR
907 origin/master
908 cool_feature
909 subfeature
910 frozen_changes *
911 master
912 .fi
913 .if n \{\
914 .RE
915 .\}
916 .sp
917
918 .PP
919 \fBgit-map\fR(1)
920 .RS 4
921 This tool shows you the history of all of your branches in a pseudo\-graphical f ormat\&. In particular, it will show you which commits all of your branches are on, which commit you currently have checked out, and more\&. Check out the doc f or the full details\&.
922 .RE
923 .PP
924 \fBgit-map-branches\fR(1)
925 .RS 4
926 This tool just shows you which branches you have in your repo, and thier upstrea m relationship to each other (as well as which branch you have checked out at th e moment)\&.
927 .RE
928 .sp
929 Additionally, sometimes you need to switch between branches, but you\(cqve got w ork in progress\&. You could use \fBgit-stash\fR(1), but that can be tricky to m anage because you need to remember which branches you stashed what changes on\&. Helpfully \fIdepot_tools\fR includes two tools which can greatly assist in case :
930 .sp
931 \fBgit-freeze\fR(1) allows you to put the current branch in \*(Aqsuspended anima tion\*(Aq by committing your changes to a specially\-named commit on the top of your current branch\&. When you come back to your branch later, you can just run \fBgit-thaw\fR(1) to get your work\-in\-progress changes back to what they were \&.
932 .sp
933 Another useful tool is \fBgit-rename-branch\fR(1)\&. Unlike git branch \-m <old> <new>, this tool will correctly preserve the upstream relationships of your bra nch compared to its downstreams\&.
934 .sp
935 Finally, take a look at \fBgit-upstream-diff\fR(1)\&. This will show you the com bined diff for all the commits on your branch against the upstream tracking bran ch\&. This is \fIexactly\fR what git cl upload will push up to code review\&. Ad ditionally, consider trying the \-\-wordwise argument to get a colorized per\-wo rd diff (instead of a per\-line diff)\&.
936 .SH "MANAGING DEPENDENT CLS"
937 .sp
938 Now that you know how to manage \fIindependent\fR CLs, we\(cqll see how to manag e \fIdependent\fR CLs\&. Dependent CLs are useful when your second (or third or fourth or \&...) CL depends on the changes in one of your other CLs (such as: CL 2 won\(cqt compile without CL 1, but you want to submit them as two separate re views)\&.
939 .sp
940 Like all of the other CLs we\(cqve created, we use \fBgit-new-branch\fR(1), but this time with an extra argument\&. First, git checkout the branch you want to b ase the new one on (i\&.e\&. CL 1), and then run:
941 .sp
942 .if n \{\
943 .RS 4
944 .\}
945 .nf
946 \fB$ git new\-branch \-\-upstream_current <branch_name>\fR
947 .fi
948 .if n \{\
949 .RE
950 .\}
951 .sp
952 .sp
953 This will make a new branch which tracks the \fIcurrent\fR branch as its upstrea m (as opposed to \fIorigin/master\fR)\&. All changes you commit to this branch w ill be in addition to the previous branch, but when you git cl upload, you will only upload the diff for the dependent (child) branch\&. You may have as many br anches nested in this fashion as you like\&.
954 .sp
955 \fBgit-map\fR(1) and \fBgit-map-branches\fR(1) are particularly helpful when you have dependent branches\&. In addition, there are two helper commands which let you traverse your working copy up and down this tree of branches: \fBgit-nav-up stream\fR(1) and \fBgit-nav-downstream\fR(1)\&.
956 .sp
957 Sometimes when dealing with dependent CLs, it turns out that you accidentally ba sed a branch on the wrong upstream, but since then you\(cqve committed changes t o it, or even based \fIanother\fR branch off of that one\&. Or you discover that you have two independent CLs that would actually be much better off as dependen t CLs\&. In instances like these, you can check out the offending branch and use \fBgit-reparent-branch\fR(1) to move it to track a different parent\&. Note tha t this can also be used to move a branch from tracking origin/master to lkgr or vice versa\&.
958 .SH "CONCLUSION"
959 .sp
960 Hopefully that gives you a good starting overview on Chromium development using \fIdepot_tools\fR\&. If you have questions which weren\(cqt answered by this tut orial or the man pages for the tools (see the index of all tools here: \fBdepot_ tools\fR(7)), please feel free to ask\&.
961 .SH "GLOSSARY"
962 .PP
963 CL
964 .RS 4
965 A
966 \fIchange\-list\fR\&. This is a diff which you would like to commit to the codeb ase\&.
967 .RE
968 .PP
969 DEPS
970 .RS 4
971 A file in the chromium checkout which
972 gclient sync
973 uses to determine what dependencies to pull in\&. This file also contains
974 \fIhooks\fR\&.
975 .RE
976 .PP
977 LKGR
978 .RS 4
979 Last Known Good Revision\&. This is a
980 \fBgit-tag\fR(1)
981 which tracks the last version of
982 origin/master
983 which has passed the full set of testing on the
984 \m[blue]\fBmain Chromium waterfall\fR\m[]\&\s-2\u[6]\d\s+2\&.
985 .RE
986 .SH "CHROMIUM DEPOT_TOOLS"
987 .sp
988 Part of the chromium \fBdepot_tools\fR(7) suite\&. These tools are meant to assi st with the development of chromium and related projects\&. Download the tools f rom \m[blue]\fBhere\fR\m[]\&\s-2\u[7]\d\s+2\&.
989 .SH "NOTES"
990 .IP " 1." 4
991 Think like (a) Git
992 .RS 4
993 \%http://think-like-a-git.net/
994 .RE
995 .IP " 2." 4
996 Git Immersion Tutorial
997 .RS 4
998 \%http://gitimmersion.com/
999 .RE
1000 .IP " 3." 4
1001 pcottle\(cqs Visual Git Branching
1002 .RS 4
1003 \%http://pcottle.github.io/learnGitBranching
1004 .RE
1005 .IP " 4." 4
1006 Pro Git book
1007 .RS 4
1008 \%http://git-scm.com/book
1009 .RE
1010 .IP " 5." 4
1011 Chromium code review site
1012 .RS 4
1013 \%https://codereview.chromium.org
1014 .RE
1015 .IP " 6." 4
1016 main Chromium waterfall
1017 .RS 4
1018 \%http://build.chromium.org
1019 .RE
1020 .IP " 7." 4
1021 here
1022 .RS 4
1023 \%https://chromium.googlesource.com/chromium/tools/depot_tools.git
1024 .RE
OLDNEW
« no previous file with comments | « docs/man7/depot_tools.7 ('k') | docs/src/.gitignore » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698