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

Side by Side Diff: docs/html/depot_tools_tutorial.html

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/html/depot_tools.html ('k') | docs/html/git-freeze.html » ('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 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" / >
6 <meta name="generator" content="AsciiDoc 8.6.9" />
7 <title>depot_tools_tutorial(7)</title>
8 <style type="text/css">
9 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
10
11 /* Default font. */
12 body {
13 font-family: Georgia,serif;
14 }
15
16 /* Title font. */
17 h1, h2, h3, h4, h5, h6,
18 div.title, caption.title,
19 thead, p.table.header,
20 #toctitle,
21 #author, #revnumber, #revdate, #revremark,
22 #footer {
23 font-family: Arial,Helvetica,sans-serif;
24 }
25
26 body {
27 margin: 1em 5% 1em 5%;
28 }
29
30 a {
31 color: blue;
32 text-decoration: underline;
33 }
34 a:visited {
35 color: fuchsia;
36 }
37
38 em {
39 font-style: italic;
40 color: navy;
41 }
42
43 strong {
44 font-weight: bold;
45 color: #083194;
46 }
47
48 h1, h2, h3, h4, h5, h6 {
49 color: #527bbd;
50 margin-top: 1.2em;
51 margin-bottom: 0.5em;
52 line-height: 1.3;
53 }
54
55 h1, h2, h3 {
56 border-bottom: 2px solid silver;
57 }
58 h2 {
59 padding-top: 0.5em;
60 }
61 h3 {
62 float: left;
63 }
64 h3 + * {
65 clear: left;
66 }
67 h5 {
68 font-size: 1.0em;
69 }
70
71 div.sectionbody {
72 margin-left: 0;
73 }
74
75 hr {
76 border: 1px solid silver;
77 }
78
79 p {
80 margin-top: 0.5em;
81 margin-bottom: 0.5em;
82 }
83
84 ul, ol, li > p {
85 margin-top: 0;
86 }
87 ul > li { color: #aaa; }
88 ul > li > * { color: black; }
89
90 .monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
94 padding: 0;
95 margin: 0;
96 }
97 pre {
98 white-space: pre-wrap;
99 }
100
101 #author {
102 color: #527bbd;
103 font-weight: bold;
104 font-size: 1.1em;
105 }
106 #email {
107 }
108 #revnumber, #revdate, #revremark {
109 }
110
111 #footer {
112 font-size: small;
113 border-top: 2px solid silver;
114 padding-top: 0.5em;
115 margin-top: 4.0em;
116 }
117 #footer-text {
118 float: left;
119 padding-bottom: 0.5em;
120 }
121 #footer-badges {
122 float: right;
123 padding-bottom: 0.5em;
124 }
125
126 #preamble {
127 margin-top: 1.5em;
128 margin-bottom: 1.5em;
129 }
130 div.imageblock, div.exampleblock, div.verseblock,
131 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
132 div.admonitionblock {
133 margin-top: 1.0em;
134 margin-bottom: 1.5em;
135 }
136 div.admonitionblock {
137 margin-top: 2.0em;
138 margin-bottom: 2.0em;
139 margin-right: 10%;
140 color: #606060;
141 }
142
143 div.content { /* Block element content. */
144 padding: 0;
145 }
146
147 /* Block element titles. */
148 div.title, caption.title {
149 color: #527bbd;
150 font-weight: bold;
151 text-align: left;
152 margin-top: 1.0em;
153 margin-bottom: 0.5em;
154 }
155 div.title + * {
156 margin-top: 0;
157 }
158
159 td div.title:first-child {
160 margin-top: 0.0em;
161 }
162 div.content div.title:first-child {
163 margin-top: 0.0em;
164 }
165 div.content + div.title {
166 margin-top: 0.0em;
167 }
168
169 div.sidebarblock > div.content {
170 background: #ffffee;
171 border: 1px solid #dddddd;
172 border-left: 4px solid #f0f0f0;
173 padding: 0.5em;
174 }
175
176 div.listingblock > div.content {
177 border: 1px solid #dddddd;
178 border-left: 5px solid #f0f0f0;
179 background: #f8f8f8;
180 padding: 0.5em;
181 }
182
183 div.quoteblock, div.verseblock {
184 padding-left: 1.0em;
185 margin-left: 1.0em;
186 margin-right: 10%;
187 border-left: 5px solid #f0f0f0;
188 color: #888;
189 }
190
191 div.quoteblock > div.attribution {
192 padding-top: 0.5em;
193 text-align: right;
194 }
195
196 div.verseblock > pre.content {
197 font-family: inherit;
198 font-size: inherit;
199 }
200 div.verseblock > div.attribution {
201 padding-top: 0.75em;
202 text-align: left;
203 }
204 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
205 div.verseblock + div.attribution {
206 text-align: left;
207 }
208
209 div.admonitionblock .icon {
210 vertical-align: top;
211 font-size: 1.1em;
212 font-weight: bold;
213 text-decoration: underline;
214 color: #527bbd;
215 padding-right: 0.5em;
216 }
217 div.admonitionblock td.content {
218 padding-left: 0.5em;
219 border-left: 3px solid #dddddd;
220 }
221
222 div.exampleblock > div.content {
223 border-left: 3px solid #dddddd;
224 padding-left: 0.5em;
225 }
226
227 div.imageblock div.content { padding-left: 0; }
228 span.image img { border-style: none; vertical-align: text-bottom; }
229 a.image:visited { color: white; }
230
231 dl {
232 margin-top: 0.8em;
233 margin-bottom: 0.8em;
234 }
235 dt {
236 margin-top: 0.5em;
237 margin-bottom: 0;
238 font-style: normal;
239 color: navy;
240 }
241 dd > *:first-child {
242 margin-top: 0.1em;
243 }
244
245 ul, ol {
246 list-style-position: outside;
247 }
248 ol.arabic {
249 list-style-type: decimal;
250 }
251 ol.loweralpha {
252 list-style-type: lower-alpha;
253 }
254 ol.upperalpha {
255 list-style-type: upper-alpha;
256 }
257 ol.lowerroman {
258 list-style-type: lower-roman;
259 }
260 ol.upperroman {
261 list-style-type: upper-roman;
262 }
263
264 div.compact ul, div.compact ol,
265 div.compact p, div.compact p,
266 div.compact div, div.compact div {
267 margin-top: 0.1em;
268 margin-bottom: 0.1em;
269 }
270
271 tfoot {
272 font-weight: bold;
273 }
274 td > div.verse {
275 white-space: pre;
276 }
277
278 div.hdlist {
279 margin-top: 0.8em;
280 margin-bottom: 0.8em;
281 }
282 div.hdlist tr {
283 padding-bottom: 15px;
284 }
285 dt.hdlist1.strong, td.hdlist1.strong {
286 font-weight: bold;
287 }
288 td.hdlist1 {
289 vertical-align: top;
290 font-style: normal;
291 padding-right: 0.8em;
292 color: navy;
293 }
294 td.hdlist2 {
295 vertical-align: top;
296 }
297 div.hdlist.compact tr {
298 margin: 0;
299 padding-bottom: 0;
300 }
301
302 .comment {
303 background: yellow;
304 }
305
306 .footnote, .footnoteref {
307 font-size: 0.8em;
308 }
309
310 span.footnote, span.footnoteref {
311 vertical-align: super;
312 }
313
314 #footnotes {
315 margin: 20px 0 20px 0;
316 padding: 7px 0 0 0;
317 }
318
319 #footnotes div.footnote {
320 margin: 0 0 5px 0;
321 }
322
323 #footnotes hr {
324 border: none;
325 border-top: 1px solid silver;
326 height: 1px;
327 text-align: left;
328 margin-left: 0;
329 width: 20%;
330 min-width: 100px;
331 }
332
333 div.colist td {
334 padding-right: 0.5em;
335 padding-bottom: 0.3em;
336 vertical-align: top;
337 }
338 div.colist td img {
339 margin-top: 0.3em;
340 }
341
342 @media print {
343 #footer-badges { display: none; }
344 }
345
346 #toc {
347 margin-bottom: 2.5em;
348 }
349
350 #toctitle {
351 color: #527bbd;
352 font-size: 1.1em;
353 font-weight: bold;
354 margin-top: 1.0em;
355 margin-bottom: 0.1em;
356 }
357
358 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
359 margin-top: 0;
360 margin-bottom: 0;
361 }
362 div.toclevel2 {
363 margin-left: 2em;
364 font-size: 0.9em;
365 }
366 div.toclevel3 {
367 margin-left: 4em;
368 font-size: 0.9em;
369 }
370 div.toclevel4 {
371 margin-left: 6em;
372 font-size: 0.9em;
373 }
374
375 span.aqua { color: aqua; }
376 span.black { color: black; }
377 span.blue { color: blue; }
378 span.fuchsia { color: fuchsia; }
379 span.gray { color: gray; }
380 span.green { color: green; }
381 span.lime { color: lime; }
382 span.maroon { color: maroon; }
383 span.navy { color: navy; }
384 span.olive { color: olive; }
385 span.purple { color: purple; }
386 span.red { color: red; }
387 span.silver { color: silver; }
388 span.teal { color: teal; }
389 span.white { color: white; }
390 span.yellow { color: yellow; }
391
392 span.aqua-background { background: aqua; }
393 span.black-background { background: black; }
394 span.blue-background { background: blue; }
395 span.fuchsia-background { background: fuchsia; }
396 span.gray-background { background: gray; }
397 span.green-background { background: green; }
398 span.lime-background { background: lime; }
399 span.maroon-background { background: maroon; }
400 span.navy-background { background: navy; }
401 span.olive-background { background: olive; }
402 span.purple-background { background: purple; }
403 span.red-background { background: red; }
404 span.silver-background { background: silver; }
405 span.teal-background { background: teal; }
406 span.white-background { background: white; }
407 span.yellow-background { background: yellow; }
408
409 span.big { font-size: 2em; }
410 span.small { font-size: 0.6em; }
411
412 span.underline { text-decoration: underline; }
413 span.overline { text-decoration: overline; }
414 span.line-through { text-decoration: line-through; }
415
416 div.unbreakable { page-break-inside: avoid; }
417
418
419 /*
420 * xhtml11 specific
421 *
422 * */
423
424 div.tableblock {
425 margin-top: 1.0em;
426 margin-bottom: 1.5em;
427 }
428 div.tableblock > table {
429 border: 3px solid #527bbd;
430 }
431 thead, p.table.header {
432 font-weight: bold;
433 color: #527bbd;
434 }
435 p.table {
436 margin-top: 0;
437 }
438 /* Because the table frame attribute is overriden by CSS in most browsers. */
439 div.tableblock > table[frame="void"] {
440 border-style: none;
441 }
442 div.tableblock > table[frame="hsides"] {
443 border-left-style: none;
444 border-right-style: none;
445 }
446 div.tableblock > table[frame="vsides"] {
447 border-top-style: none;
448 border-bottom-style: none;
449 }
450
451
452 /*
453 * html5 specific
454 *
455 * */
456
457 table.tableblock {
458 margin-top: 1.0em;
459 margin-bottom: 1.5em;
460 }
461 thead, p.tableblock.header {
462 font-weight: bold;
463 color: #527bbd;
464 }
465 p.tableblock {
466 margin-top: 0;
467 }
468 table.tableblock {
469 border-width: 3px;
470 border-spacing: 0px;
471 border-style: solid;
472 border-color: #527bbd;
473 border-collapse: collapse;
474 }
475 th.tableblock, td.tableblock {
476 border-width: 1px;
477 padding: 4px;
478 border-style: solid;
479 border-color: #527bbd;
480 }
481
482 table.tableblock.frame-topbot {
483 border-left-style: hidden;
484 border-right-style: hidden;
485 }
486 table.tableblock.frame-sides {
487 border-top-style: hidden;
488 border-bottom-style: hidden;
489 }
490 table.tableblock.frame-none {
491 border-style: hidden;
492 }
493
494 th.tableblock.halign-left, td.tableblock.halign-left {
495 text-align: left;
496 }
497 th.tableblock.halign-center, td.tableblock.halign-center {
498 text-align: center;
499 }
500 th.tableblock.halign-right, td.tableblock.halign-right {
501 text-align: right;
502 }
503
504 th.tableblock.valign-top, td.tableblock.valign-top {
505 vertical-align: top;
506 }
507 th.tableblock.valign-middle, td.tableblock.valign-middle {
508 vertical-align: middle;
509 }
510 th.tableblock.valign-bottom, td.tableblock.valign-bottom {
511 vertical-align: bottom;
512 }
513
514
515 /*
516 * manpage specific
517 *
518 * */
519
520 body.manpage h1 {
521 padding-top: 0.5em;
522 padding-bottom: 0.5em;
523 border-top: 2px solid silver;
524 border-bottom: 2px solid silver;
525 }
526 body.manpage h2 {
527 border-style: none;
528 }
529 body.manpage div.sectionbody {
530 margin-left: 3em;
531 }
532
533 @media print {
534 body.manpage div#toc { display: none; }
535 }
536
537
538 div.listingblock > div.content {
539 background: rgb(28, 28, 28);
540 }
541
542 div.listingblock > div > pre > code {
543 color: rgb(187, 187, 187);
544 }
545 </style>
546 <script type="text/javascript">
547 /*<![CDATA[*/
548 var asciidoc = { // Namespace.
549
550 /////////////////////////////////////////////////////////////////////
551 // Table Of Contents generator
552 /////////////////////////////////////////////////////////////////////
553
554 /* Author: Mihai Bazon, September 2002
555 * http://students.infoiasi.ro/~mishoo
556 *
557 * Table Of Content generator
558 * Version: 0.4
559 *
560 * Feel free to use this script under the terms of the GNU General Public
561 * License, as long as you do not remove or alter this notice.
562 */
563
564 /* modified by Troy D. Hanson, September 2006. License: GPL */
565 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
566
567 // toclevels = 1..4.
568 toc: function (toclevels) {
569
570 function getText(el) {
571 var text = "";
572 for (var i = el.firstChild; i != null; i = i.nextSibling) {
573 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
574 text += i.data;
575 else if (i.firstChild != null)
576 text += getText(i);
577 }
578 return text;
579 }
580
581 function TocEntry(el, text, toclevel) {
582 this.element = el;
583 this.text = text;
584 this.toclevel = toclevel;
585 }
586
587 function tocEntries(el, toclevels) {
588 var result = new Array;
589 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
590 // Function that scans the DOM tree for header elements (the DOM2
591 // nodeIterator API would be a better technique but not supported by all
592 // browsers).
593 var iterate = function (el) {
594 for (var i = el.firstChild; i != null; i = i.nextSibling) {
595 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
596 var mo = re.exec(i.tagName);
597 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
598 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
599 }
600 iterate(i);
601 }
602 }
603 }
604 iterate(el);
605 return result;
606 }
607
608 var toc = document.getElementById("toc");
609 if (!toc) {
610 return;
611 }
612
613 // Delete existing TOC entries in case we're reloading the TOC.
614 var tocEntriesToRemove = [];
615 var i;
616 for (i = 0; i < toc.childNodes.length; i++) {
617 var entry = toc.childNodes[i];
618 if (entry.nodeName.toLowerCase() == 'div'
619 && entry.getAttribute("class")
620 && entry.getAttribute("class").match(/^toclevel/))
621 tocEntriesToRemove.push(entry);
622 }
623 for (i = 0; i < tocEntriesToRemove.length; i++) {
624 toc.removeChild(tocEntriesToRemove[i]);
625 }
626
627 // Rebuild TOC entries.
628 var entries = tocEntries(document.getElementById("content"), toclevels);
629 for (var i = 0; i < entries.length; ++i) {
630 var entry = entries[i];
631 if (entry.element.id == "")
632 entry.element.id = "_toc_" + i;
633 var a = document.createElement("a");
634 a.href = "#" + entry.element.id;
635 a.appendChild(document.createTextNode(entry.text));
636 var div = document.createElement("div");
637 div.appendChild(a);
638 div.className = "toclevel" + entry.toclevel;
639 toc.appendChild(div);
640 }
641 if (entries.length == 0)
642 toc.parentNode.removeChild(toc);
643 },
644
645
646 /////////////////////////////////////////////////////////////////////
647 // Footnotes generator
648 /////////////////////////////////////////////////////////////////////
649
650 /* Based on footnote generation code from:
651 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
652 */
653
654 footnotes: function () {
655 // Delete existing footnote entries in case we're reloading the footnodes.
656 var i;
657 var noteholder = document.getElementById("footnotes");
658 if (!noteholder) {
659 return;
660 }
661 var entriesToRemove = [];
662 for (i = 0; i < noteholder.childNodes.length; i++) {
663 var entry = noteholder.childNodes[i];
664 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
665 entriesToRemove.push(entry);
666 }
667 for (i = 0; i < entriesToRemove.length; i++) {
668 noteholder.removeChild(entriesToRemove[i]);
669 }
670
671 // Rebuild footnote entries.
672 var cont = document.getElementById("content");
673 var spans = cont.getElementsByTagName("span");
674 var refs = {};
675 var n = 0;
676 for (i=0; i<spans.length; i++) {
677 if (spans[i].className == "footnote") {
678 n++;
679 var note = spans[i].getAttribute("data-note");
680 if (!note) {
681 // Use [\s\S] in place of . so multi-line matches work.
682 // Because JavaScript has no s (dotall) regex flag.
683 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
684 spans[i].innerHTML =
685 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
686 "' title='View footnote' class='footnote'>" + n + "</a>]";
687 spans[i].setAttribute("data-note", note);
688 }
689 noteholder.innerHTML +=
690 "<div class='footnote' id='_footnote_" + n + "'>" +
691 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
692 n + "</a>. " + note + "</div>";
693 var id =spans[i].getAttribute("id");
694 if (id != null) refs["#"+id] = n;
695 }
696 }
697 if (n == 0)
698 noteholder.parentNode.removeChild(noteholder);
699 else {
700 // Process footnoterefs.
701 for (i=0; i<spans.length; i++) {
702 if (spans[i].className == "footnoteref") {
703 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
704 href = href.match(/#.*/)[0]; // Because IE return full URL.
705 n = refs[href];
706 spans[i].innerHTML =
707 "[<a href='#_footnote_" + n +
708 "' title='View footnote' class='footnote'>" + n + "</a>]";
709 }
710 }
711 }
712 },
713
714 install: function(toclevels) {
715 var timerId;
716
717 function reinstall() {
718 asciidoc.footnotes();
719 if (toclevels) {
720 asciidoc.toc(toclevels);
721 }
722 }
723
724 function reinstallAndRemoveTimer() {
725 clearInterval(timerId);
726 reinstall();
727 }
728
729 timerId = setInterval(reinstall, 500);
730 if (document.addEventListener)
731 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false );
732 else
733 window.onload = reinstallAndRemoveTimer;
734 }
735
736 }
737 asciidoc.install();
738 /*]]>*/
739 </script>
740 </head>
741 <body class="manpage">
742 <div id="header">
743 <h1>
744 depot_tools_tutorial(7) Manual Page
745 </h1>
746 <h2>NAME</h2>
747 <div class="sectionbody">
748 <p>depot_tools_tutorial -
749 A tutorial introduction to the Chromium depot_tools git extensions.
750 </p>
751 </div>
752 </div>
753 <div id="content">
754 <div class="sect1">
755 <h2 id="_description">DESCRIPTION</h2>
756 <div class="sectionbody">
757 <div class="paragraph"><p>The Chromium <a href="depot_tools.html">depot_tools(7) </a> suite contains many git workflow-enhancing
758 tools which are designed to work together to enable anyone to wrangle the
759 Chromium codebase expertly. This tutorial explains how to do development on
760 Chromium using these tools. This will cover:</p></div>
761 <div class="ulist"><ul>
762 <li>
763 <p>
764 <a href="#_setting_up">Setting up</a>
765 </p>
766 </li>
767 <li>
768 <p>
769 <a href="#_getting_the_code">Getting the code</a>
770 </p>
771 </li>
772 <li>
773 <p>
774 <a href="#_tl_dr_walkthrough">TL;DR Walkthrough</a>
775 </p>
776 </li>
777 <li>
778 <p>
779 <a href="#_creating_uploading_a_cl">Creating / Uploading a CL</a>
780 </p>
781 </li>
782 <li>
783 <p>
784 <a href="#_updating_the_code">Updating the code</a>
785 </p>
786 </li>
787 <li>
788 <p>
789 <a href="#_managing_multiple_cls">Managing multiple CLs</a>
790 </p>
791 </li>
792 <li>
793 <p>
794 <a href="#_managing_dependent_cls">Managing dependent CLs</a>
795 </p>
796 </li>
797 </ul></div>
798 <div class="paragraph"><p>Please refer to the manpages (or <code>--help</code> o utput) for details about any of the
799 commands mentioned in this tutorial.</p></div>
800 <div class="admonitionblock">
801 <table><tr>
802 <td class="icon">
803 <div class="title">Note</div>
804 </td>
805 <td class="content">If your platform does not support manpages (or you prefer so mething a bit more
806 expressive than plain text) you can find all documentation in <em>html</em> form in the
807 <code>[DEPOT_TOOLS]/docs/html</code> folder.</td>
808 </tr></table>
809 </div>
810 <div class="sect2">
811 <h3 id="_prerequisites">PREREQUISITES</h3>
812 <div class="paragraph"><p>This tutorial assumes basic familiarity with git termi nology and concepts. If you
813 need to brush up on these, the following are very good resources:</p></div>
814 <div class="ulist"><ul>
815 <li>
816 <p>
817 <a href="http://think-like-a-git.net/">Think like (a) Git</a> - A lighthearted
818 overview of git. If you&#8217;re sorta-familiar with git, but not <em>comforta ble</em> with
819 it, then give this a look.
820 </p>
821 </li>
822 <li>
823 <p>
824 <a href="http://gitimmersion.com/">Git Immersion Tutorial</a> - An in-depth git
825 tutorial.
826 </p>
827 </li>
828 <li>
829 <p>
830 <a href="http://pcottle.github.io/learnGitBranching">pcottle&#8217;s Visual Git
831 Branching</a> - An excellent interactive/graphical demo on how git handles
832 commits, branches, and shows the operations git performs on them.
833 </p>
834 </li>
835 <li>
836 <p>
837 <a href="http://git-scm.com/book">Pro Git book</a> - &#8220;The&#8221; book for learning git
838 from basics to advanced concepts. A bit dry, but very through.
839 </p>
840 </li>
841 </ul></div>
842 <div class="paragraph"><p>If you&#8217;ve tried these out and are still having s ome trouble getting started,
843 there are <em>many</em> other resources online which should help. If you&#8217;r e <em>really</em>
844 <strong><em>really</em></strong> stuck, then chat up one of the Chromium infrast ructure team
845 members for some pointers.</p></div>
846 <div class="dlist"><dl>
847 <dt class="hdlist1">
848 Litmus Test
849 </dt>
850 <dd>
851 <p>
852 If you know what <code>git add</code>, <code>git status</code>, <code>git comm it</code> do and you know
853 <em>essentially</em> what <code>git rebase</code> does, then you should know e nough to follow
854 along.
855 </p>
856 </dd>
857 </dl></div>
858 </div>
859 </div>
860 </div>
861 <div class="sect1">
862 <h2 id="_setting_up">SETTING UP</h2>
863 <div class="sectionbody">
864 <div class="sect2">
865 <h3 id="_get_depot_tools">GET DEPOT TOOLS</h3>
866 <div class="sect3">
867 <h4 id="_linux_mac">LINUX / MAC</h4>
868 <div class="paragraph"><p>Clone the <em>depot_tools</em> repository:</p></div>
869 <div class="listingblock">
870 <div class="content">
871 <pre><code><strong><span class="white">$ git clone https://chromium.googlesource .com/chromium/tools/depot_tools</span></strong></code></pre>
872 </div></div>
873 <div class="paragraph"><p>Add <em>depot_tools</em> to the <em>end</em> of your P ATH and MANPATH (you will probably want
874 to put this in your <code>~/.bashrc</code> or <code>~/.zshrc</code>). Assuming y ou cloned
875 <em>depot_tools</em> to <code>/path/to/depot_tools</code>:</p></div>
876 <div class="listingblock">
877 <div class="content">
878 <pre><code><strong><span class="white">$ export PATH=$PATH:/path/to/depot_tools< /span></strong>
879 <strong><span class="white">$ export MANPATH=$MANPATH:/path/to/depot_tools/docs< /span></strong> <b>&lt;1&gt;</b></code></pre>
880 </div></div>
881 <div class="colist arabic"><ol>
882 <li>
883 <p>
884 Observe that this path is <code>depot_tools/</code><strong><code>docs</code></st rong>.
885 </p>
886 </li>
887 </ol></div>
888 </div>
889 <div class="sect3">
890 <h4 id="_windows">WINDOWS</h4>
891 <div class="paragraph"><p>Download the <em>depot_tools</em>
892 <a href="https://src.chromium.org/svn/trunk/tools/depot_tools.zip">bundle</a> an d
893 extract it somewhere.</p></div>
894 <div class="admonitionblock">
895 <table><tr>
896 <td class="icon">
897 <div class="title">Warning</div>
898 </td>
899 <td class="content"><strong>DO NOT</strong> use drag-n-drop or copy-n-paste extr act from Explorer, this will not
900 extract the hidden &#8220;.git&#8221; folder which is necessary for <em>depot_to ols</em> to
901 autoupdate itself. You can use &#8220;Extract all&#8230;&#8221; from the context menu though.</td>
902 </tr></table>
903 </div>
904 <div class="paragraph"><p>Add <em>depot_tools</em> to the <em>end</em> of your P ATH. Assuming you unzipped the
905 bundle to <code>C:\workspace\depot_tools</code>:</p></div>
906 <div class="dlist"><dl>
907 <dt class="hdlist1">
908 With Administrator access:
909 </dt>
910 <dd>
911 <p>
912 <strong>Control Panel &#8594; System and Security &#8594; System &#8594; Advan ced system settings</strong>
913 </p>
914 <div class="paragraph"><p>Modify the PATH system variable to include <code>C:\wo rkspace\depot_tools</code>.</p></div>
915 </dd>
916 <dt class="hdlist1">
917 Without Administrator access:
918 </dt>
919 <dd>
920 <p>
921 <strong>Control Panel &#8594; User Accounts &#8594; User Accounts &#8594; Chan ge my environment variables</strong>
922 </p>
923 <div class="paragraph"><p>Add a PATH user variable: <code>%PATH%;C:\workspace\de pot_tools</code>.</p></div>
924 </dd>
925 </dl></div>
926 <div class="paragraph"><p>From a <code>cmd.exe</code> shell, run the command <co de>gclient</code> (without arguments). On first
927 run, gclient will install all the Windows-specific bits needed to work with the
928 code, including msysgit and python.</p></div>
929 <div class="admonitionblock">
930 <table><tr>
931 <td class="icon">
932 <div class="title">Note</div>
933 </td>
934 <td class="content">
935 <div class="ulist"><ul>
936 <li>
937 <p>
938 If you run gclient from a non-cmd shell (e.g., cygwin, PowerShell), it
939 may appear to run properly, but msysgit, python, and other tools may not get
940 installed correctly.
941 </p>
942 </li>
943 <li>
944 <p>
945 If you see strange errors with the file system on the first run of gclient,
946 you may want to <a href="http://tortoisesvn.tigris.org/faq.html#cantmove2">dis able
947 Windows Indexing</a>.
948 </p>
949 </li>
950 <li>
951 <p>
952 If you are running Windows XP and see errors like &#8220;The system cannot execu te
953 the specified program&#8221;, try installing the
954 <a href="http://code.google.com/p/chromium/issues/detail?id=75886">&#8220;Micr osoft
955 Visual C++ 2008 Redistributable Package&#8221;</a>.
956 </p>
957 </li>
958 </ul></div>
959 </td>
960 </tr></table>
961 </div>
962 </div>
963 </div>
964 <div class="sect2">
965 <h3 id="_bootstrapping_configuration">BOOTSTRAPPING CONFIGURATION</h3>
966 <div class="paragraph"><p>If you have never used git before, you’ll need to set some global git
967 configurations; substitute your name and email address in the following
968 commands:</p></div>
969 <div class="listingblock">
970 <div class="content">
971 <pre><code><strong><span class="white">$ git config --global user.name &#8220;Jo hn Doe&#8221;</span></strong>
972 <strong><span class="white">$ git config --global user.email &#8220;jdoe@email.c om&#8221;</span></strong>
973 <strong><span class="white">$ git config --global core.autocrlf false</span></st rong>
974 <strong><span class="white">$ git config --global core.filemode false</span></st rong>
975 <strong><span class="white">$</span></strong> # and for fun!
976 <strong><span class="white">$ git config --global color.ui true</span></strong>< /code></pre>
977 </div></div>
978 </div>
979 </div>
980 </div>
981 <div class="sect1">
982 <h2 id="_getting_the_code">GETTING THE CODE</h2>
983 <div class="sectionbody">
984 <div class="paragraph"><p>Pick an empty directory and run one of the following:< /p></div>
985 <div class="listingblock">
986 <div class="content">
987 <pre><code><strong><span class="white">$ fetch chromium</span></strong> # Basic checkout for desktop Chromium
988 <strong><span class="white">$ fetch blink</span></strong> # Chromium code wi th Blink checked out to tip-of-tree
989 <strong><span class="white">$ fetch android</span></strong> # Chromium checkou t for Android platform
990 <strong><span class="white">$ fetch ios</span></strong> # Chromium checkou t for iOS platform</code></pre>
991 </div></div>
992 <div class="paragraph"><p>When the <code>fetch</code> tool completes you should have the following in your working
993 directory:</p></div>
994 <div class="listingblock">
995 <div class="content">
996 <pre><code><strong><span class="white">.gclient</span></strong> # A configurat ion file for you source checkout
997 <strong><span class="white">src/</span></strong> # Top-level Chromium sour ce checkout.</code></pre>
998 </div></div>
999 <div class="paragraph"><p>If you are on linux, then you&#8217;ll need to run:</p ></div>
1000 <div class="listingblock">
1001 <div class="content">
1002 <pre><code><strong><span class="white">$ cd src &amp;&amp; ./build/install-build -deps.sh</span></strong></code></pre>
1003 </div></div>
1004 <div class="paragraph"><p>And finally:</p></div>
1005 <div class="listingblock">
1006 <div class="content">
1007 <pre><code><strong><span class="white">$ gclient sync</span></strong> <b>&lt;1&g t;</b></code></pre>
1008 </div></div>
1009 <div class="colist arabic"><ol>
1010 <li>
1011 <p>
1012 This will pull all dependencies of the Chromium src checkout. You will need
1013 to run this any time you update the main src checkout.
1014 </p>
1015 </li>
1016 </ol></div>
1017 </div>
1018 </div>
1019 <div class="sect1">
1020 <h2 id="_tl_dr_walkthrough">TL;DR WALKTHROUGH</h2>
1021 <div class="sectionbody">
1022 <div class="paragraph"><p>This section will demo what a typical workflow looks l ike when writing, updating,
1023 and committing multiple CLs.</p></div>
1024 <div class="paragraph"><p></p></div><div class="listingblock"><div class="conten t"><pre><code><span style="font-weight: bold; color: #ffffff">$ fetch chromium</ span>
1025 ... truncated output ...
1026 <span style="font-weight: bold; color: #ffffff">$ cd src</span>
1027 </code></pre></div></div><p><div class="paragraph"> (only on linux)</p></div><di v class="listingblock"><div class="content"><pre><code><span style="font-weight: bold; color: #ffffff">$ ./build/install-build-deps.sh</span>
1028 ... truncated output ...
1029 </code></pre></div></div><p><div class="paragraph"> Pull in all dependencies for HEAD</p></div><div class="listingblock"><div class="content"><pre><code><span s tyle="font-weight: bold; color: #ffffff">$ gclient sync</span>
1030 ... truncated output ...
1031 </code></pre></div></div><p><div class="paragraph"> Let's fix something!</p></di v><div class="listingblock"><div class="content"><pre><code><span style="font-we ight: bold; color: #ffffff">$ git new-branch fix_typo</span>
1032 <span style="font-weight: bold; color: #ffffff">$ echo -e '/Banana\ns/Banana/Kuu n\nwq' | ed build/whitespace_file.txt</span>
1033 1503
1034 It was a Domo-Banana.
1035 It was a Domo-Kuun.
1036 1501
1037 <span style="font-weight: bold; color: #ffffff">$ git commit -am 'Fix terrible t ypo.'</span>
1038 [fix_typo 615ffa7] Fix terrible typo.
1039 1 file changed, 1 insertion(+), 1 deletion(-)
1040 <span style="font-weight: bold; color: #ffffff">$ git map</span>
1041 <span style="background-color: #492ee1"></span><span style="font-weight: bold; b ackground-color: #492ee1">* </span><span style="font-weight: bold; color: #e42e1 6; background-color: #492ee1">615ffa7 </span><span style="color: #19c518"> (</ span><span style="color: #33d6e5"></span><span style="font-weight: bold; color: #33d6e5">fix_typo</span><span style="font-weight: bold"></span><span style="font -weight: bold"></span><span style="color: #19c518">) </span><span style="color: #e7e71c">2014-04-10</span> ~ Fix terrible typo.
1042 * <span style="font-weight: bold; color: #e42e16">beec6f4 </span><span sty le="color: #19c518"> (</span><span style="color: #e42e16">origin/master</span><s pan style="color: #19c518">, </span><span style="color: #e42e16">origin/HEAD</sp an><span style="color: #19c518">) </span><span style="color: #e7e71c">2014-04-10 </span> ~ Make ReflectorImpl use mailboxes<span style="font-weight: bold"></span ><span style="font-weight: bold; color: #ffffff"> &lt;(fix_typo)</span><span style="font-weight: bold"></span><span style="font-weight: bold"></span>
1043 * <span style="font-weight: bold; color: #e42e16">41290e0 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ don 't use glibc-specific execinfo.h on uclibc builds
1044 * <span style="font-weight: bold; color: #e42e16">a76fde7 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ [fs p] Add requestUnmount() method together with the request manager.
1045 * <span style="font-weight: bold; color: #e42e16">9de7a71 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ lin ux_aura: Use system configuration for middle clicking the titlebar.
1046 * <span style="font-weight: bold; color: #e42e16">073b0c2 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Con tentView-&gt;ContentViewCore in ContentViewRenderView
1047 * <span style="font-weight: bold; color: #e42e16">2250f53 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ ozo ne: evdev: Filter devices by path
1048 * <span style="font-weight: bold; color: #e42e16">33a7a74 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Alw ays output seccomp error messages to stderr
1049 <span style="font-weight: bold; color: #ffffff">$ git status</span>
1050 On branch fix_typo
1051 Your branch is ahead of 'origin/master' by 1 commit.
1052 (use "git push" to publish your local commits)
1053
1054 nothing to commit, working directory clean
1055 <span style="font-weight: bold; color: #ffffff">$ git cl upload -r domo@chromium .org --send-mail</span>
1056 ... truncated output ...
1057 </code></pre></div></div><p><div class="paragraph"> While we wait for feedback, let's do something else.</p></div><div class="listingblock"><div class="content" ><pre><code><span style="font-weight: bold; color: #ffffff">$ git new-branch cha p2</span>
1058 <span style="font-weight: bold; color: #ffffff">$ git map-branches</span>
1059 <span style="color: #e42e16"></span><span style="font-weight: bold; color: #e42e 16">origin/master
1060 </span><span style="font-weight: bold; color: #33d6e5"></span><span style="font- weight: bold; color: #33d6e5"> chap2 *
1061 </span><span style="font-weight: bold; color: #19c518"></span><span style="color : #19c518"> fix_typo
1062 </span><span style="font-weight: bold; color: #ffffff">$ cat &gt;&gt; build/whit espace_file.txt &lt;&lt;EOF</span>
1063
1064 "You recall what happened on Mulholland drive?" The ceiling fan rotated slowly
1065 overhead, barely disturbing the thick cigarette smoke. No doubt was left about
1066 when the fan was last cleaned.
1067 EOF
1068 <span style="font-weight: bold; color: #ffffff">$ git status</span>
1069 On branch chap2
1070 Your branch is up-to-date with 'origin/master'.
1071
1072 Changes not staged for commit:
1073 (use "git add &lt;file&gt;..." to update what will be committed)
1074 (use "git checkout -- &lt;file&gt;..." to discard changes in working directory )
1075
1076 <span style="color: #e42e16">modified: build/whitespace_file.txt</span >
1077
1078 no changes added to commit (use "git add" and/or "git commit -a")
1079 </code></pre></div></div><p><div class="paragraph"> Someone on the code review p ointed out that our typo-fix has a typo :( We're still working on 'chap2' but we really want to land 'fix_typo', so let's switch over and fix it.</p></div><div class="listingblock"><div class="content"><pre><code><span style="font-weight: b old; color: #ffffff">$ git freeze</span>
1080 <span style="font-weight: bold; color: #ffffff">$ git checkout fix_typo</span>
1081 Switched to branch 'fix_typo'
1082 Your branch is ahead of 'origin/master' by 1 commit.
1083 (use "git push" to publish your local commits)
1084 <span style="font-weight: bold; color: #ffffff">$ echo -e '/Kuun\ns/Kuun/Kun\nwq ' | ed build/whitespace_file.txt</span>
1085 1501
1086 It was a Domo-Kuun.
1087 It was a Domo-Kun.
1088 1500
1089 <span style="font-weight: bold; color: #ffffff">$ git upstream-diff --wordwise</ span>
1090 <span style="font-weight: bold">diff --git a/build/whitespace_file.txt b/build/w hitespace_file.txt</span>
1091 <span style="font-weight: bold">index 3eba355..57cdcee 100644</span>
1092 <span style="font-weight: bold">--- a/build/whitespace_file.txt</span>
1093 <span style="font-weight: bold">+++ b/build/whitespace_file.txt</span>
1094 <span style="color: #33d6e5">@@ -17,7 +17,7 @@</span> swept up the streets (for it is in London that our scene lies), rattling along
1095 the housetops, and fiercely agitating the scanty flame of the lamps that
1096 struggled against the elements. A hooded figure emerged.
1097
1098 It was a Domo-<span style="color: #e42e16">Banana</span><span style="color: #19c 518">Kun</span>.
1099
1100 "What took you so long?", inquired his wife.
1101
1102 <span style="font-weight: bold; color: #ffffff">$ git commit -am 'Fix typo for g ood!'</span>
1103 [fix_typo 2c0ad9c] Fix typo for good!
1104 1 file changed, 1 insertion(+), 1 deletion(-)
1105 <span style="font-weight: bold; color: #ffffff">$ git cl upload</span>
1106 ... truncated output ...
1107 </code></pre></div></div><p><div class="paragraph"> Since we got lgtm, let the C Q land it.</p></div><div class="listingblock"><div class="content"><pre><code><s pan style="font-weight: bold; color: #ffffff">$ git cl set_commit</span>
1108 <span style="font-weight: bold; color: #ffffff">$ git map</span>
1109 * <span style="font-weight: bold; color: #e42e16">0e2e52e </span><span sty le="color: #19c518"> (</span><span style="color: #19c518"></span><span style="fo nt-weight: bold; color: #19c518">chap2</span><span style="font-weight: bold"></s pan><span style="font-weight: bold"></span><span style="color: #19c518">) </span ><span style="color: #e7e71c">2014-04-10</span> ~ FREEZE.unindexed
1110 <span style="color: #e42e16">|</span> <span style="background-color: #492ee1"></ span><span style="font-weight: bold; background-color: #492ee1">* </span><span s tyle="font-weight: bold; color: #e42e16; background-color: #492ee1">2c0ad9c </span><span style="color: #19c518"> (</span><span style="color: #33d6e5"></span ><span style="font-weight: bold; color: #33d6e5">fix_typo</span><span style="fon t-weight: bold"></span><span style="font-weight: bold"></span><span style="color : #19c518">) </span><span style="color: #e7e71c">2014-04-10</span> ~ Fix typo fo r good!
1111 <span style="color: #e42e16">|</span> * <span style="font-weight: bold; color: # e42e16">615ffa7 </span><span style="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Fix terrible typo.
1112 <span style="color: #e42e16">|</span><span style="color: #e42e16">/</span>
1113 * <span style="font-weight: bold; color: #e42e16">beec6f4 </span><span sty le="color: #19c518"> (</span><span style="color: #e42e16">origin/master</span><s pan style="color: #19c518">, </span><span style="color: #e42e16">origin/HEAD</sp an><span style="color: #19c518">) </span><span style="color: #e7e71c">2014-04-10 </span> ~ Make ReflectorImpl use mailboxes<span style="font-weight: bold"></span ><span style="font-weight: bold; color: #ffffff"> &lt;(chap2, fix_typo)</span ><span style="font-weight: bold"></span><span style="font-weight: bold"></span>
1114 * <span style="font-weight: bold; color: #e42e16">41290e0 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ don 't use glibc-specific execinfo.h on uclibc builds
1115 * <span style="font-weight: bold; color: #e42e16">a76fde7 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ [fs p] Add requestUnmount() method together with the request manager.
1116 * <span style="font-weight: bold; color: #e42e16">9de7a71 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ lin ux_aura: Use system configuration for middle clicking the titlebar.
1117 * <span style="font-weight: bold; color: #e42e16">073b0c2 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Con tentView-&gt;ContentViewCore in ContentViewRenderView
1118 * <span style="font-weight: bold; color: #e42e16">2250f53 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ ozo ne: evdev: Filter devices by path
1119 * <span style="font-weight: bold; color: #e42e16">33a7a74 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Alw ays output seccomp error messages to stderr
1120 </code></pre></div></div><p><div class="paragraph"> Switch back to where we were using the nav* commands (for fun... git checkout would work here too)</p></div> <div class="listingblock"><div class="content"><pre><code><span style="font-weig ht: bold; color: #ffffff">$ git map-branches</span>
1121 <span style="color: #e42e16"></span><span style="color: #e42e16">origin/master
1122 </span><span style="color: #19c518"></span><span style="color: #19c518"> chap2
1123 </span><span style="color: #33d6e5"></span><span style="font-weight: bold; color : #33d6e5"> fix_typo *
1124 </span><span style="font-weight: bold; color: #ffffff">$ git nav-upstream</span>
1125 Note: checking out 'origin/master'.
1126
1127 You are in 'detached HEAD' state. You can look around, make experimental
1128 changes and commit them, and you can discard any commits you make in this
1129 state without impacting any branches by performing another checkout.
1130
1131 If you want to create a new branch to retain commits you create, you may
1132 do so (now or later) by using -b with the checkout command again. Example:
1133
1134 git checkout -b new_branch_name
1135
1136 HEAD is now at beec6f4... Make ReflectorImpl use mailboxes
1137 <span style="font-weight: bold; color: #ffffff">$ git nav-downstream</span>
1138 Please select a downstream branch
1139 0. chap2
1140 1. fix_typo
1141 Selection (0-1)[0]: 0
1142 Previous HEAD position was beec6f4... Make ReflectorImpl use mailboxes
1143 Switched to branch 'chap2'
1144 Your branch is ahead of 'origin/master' by 1 commit.
1145 (use "git push" to publish your local commits)
1146 <span style="font-weight: bold; color: #ffffff">$ git map-branches</span>
1147 <span style="color: #e42e16"></span><span style="color: #e42e16">origin/master
1148 </span><span style="color: #33d6e5"></span><span style="font-weight: bold; color : #33d6e5"> chap2 *
1149 </span><span style="font-weight: bold; color: #19c518"></span><span style="color : #19c518"> fix_typo
1150 </code></pre></div></div><p><div class="paragraph"> Now we can pick up on chapte r2 where we left off.</p></div><div class="listingblock"><div class="content"><p re><code></span><span style="font-weight: bold; color: #ffffff">$ git thaw</span >
1151 <span style="font-weight: bold; color: #ffffff">$ git diff</span>
1152 <span style="font-weight: bold">diff --git a/build/whitespace_file.txt b/build/w hitespace_file.txt</span>
1153 <span style="font-weight: bold">index 3eba355..9d08d9d 100644</span>
1154 <span style="font-weight: bold">--- a/build/whitespace_file.txt</span>
1155 <span style="font-weight: bold">+++ b/build/whitespace_file.txt</span>
1156 <span style="color: #33d6e5">@@ -34,3 +34,7 @@</span> with his fork, watching th e runny jelly spread and pool across his plate,
1157 like the blood of a dying fawn. \"It reminds me of that time --\" he started, a s
1158 his wife cut in quickly: \"-- please. I can't bear to hear it.\". A flury of
1159 images coming from the past flowed through his mind.
1160 <span style="color: #19c518">+</span>
1161 <span style="color: #19c518">+</span><span style="color: #19c518">"You recall wh at happened on Mulholland drive?" The ceiling fan rotated slowly</span>
1162 <span style="color: #19c518">+</span><span style="color: #19c518">overhead, bare ly disturbing the thick cigarette smoke. No doubt was left about</span>
1163 <span style="color: #19c518">+</span><span style="color: #19c518">when the fan w as last cleaned.</span>
1164 <span style="font-weight: bold; color: #ffffff">$ cat &gt;&gt; build/whitespace_ file.txt &lt;&lt;EOF</span>
1165
1166 There was an poignant pause.
1167 EOF
1168 <span style="font-weight: bold; color: #ffffff">$ git diff</span>
1169 <span style="font-weight: bold">diff --git a/build/whitespace_file.txt b/build/w hitespace_file.txt</span>
1170 <span style="font-weight: bold">index 3eba355..e3a55de 100644</span>
1171 <span style="font-weight: bold">--- a/build/whitespace_file.txt</span>
1172 <span style="font-weight: bold">+++ b/build/whitespace_file.txt</span>
1173 <span style="color: #33d6e5">@@ -34,3 +34,9 @@</span> with his fork, watching th e runny jelly spread and pool across his plate,
1174 like the blood of a dying fawn. \"It reminds me of that time --\" he started, a s
1175 his wife cut in quickly: \"-- please. I can't bear to hear it.\". A flury of
1176 images coming from the past flowed through his mind.
1177 <span style="color: #19c518">+</span>
1178 <span style="color: #19c518">+</span><span style="color: #19c518">"You recall wh at happened on Mulholland drive?" The ceiling fan rotated slowly</span>
1179 <span style="color: #19c518">+</span><span style="color: #19c518">overhead, bare ly disturbing the thick cigarette smoke. No doubt was left about</span>
1180 <span style="color: #19c518">+</span><span style="color: #19c518">when the fan w as last cleaned.</span>
1181 <span style="color: #19c518">+</span>
1182 <span style="color: #19c518">+</span><span style="color: #19c518">There was an p oignant pause.</span>
1183 <span style="font-weight: bold; color: #ffffff">$ git commit -am 'Finish chapter 2'</span>
1184 [chap2 ceef712] Finish chapter 2
1185 1 file changed, 6 insertions(+)
1186 <span style="font-weight: bold; color: #ffffff">$ git map</span>
1187 <span style="background-color: #492ee1"></span><span style="font-weight: bold; b ackground-color: #492ee1">* </span><span style="font-weight: bold; color: #e42e1 6; background-color: #492ee1">ceef712 </span><span style="color: #19c518"> (</ span><span style="color: #33d6e5"></span><span style="font-weight: bold; color: #33d6e5">chap2</span><span style="font-weight: bold"></span><span style="font-we ight: bold"></span><span style="color: #19c518">) </span><span style="color: #e7 e71c">2014-04-10</span> ~ Finish chapter 2
1188 <span style="color: #e42e16">|</span> * <span style="font-weight: bold; color: # e42e16">2c0ad9c </span><span style="color: #19c518"> (</span><span style="color: #19c518"></span><span style="font-weight: bold; color: #19c518">fix_typo</span> <span style="font-weight: bold"></span><span style="font-weight: bold"></span><s pan style="color: #19c518">) </span><span style="color: #e7e71c">2014-04-10</spa n> ~ Fix typo for good!
1189 <span style="color: #e42e16">|</span> * <span style="font-weight: bold; color: # e42e16">615ffa7 </span><span style="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Fix terrible typo.
1190 <span style="color: #e42e16">|</span><span style="color: #e42e16">/</span>
1191 * <span style="font-weight: bold; color: #e42e16">beec6f4 </span><span sty le="color: #19c518"> (</span><span style="color: #e42e16">origin/master</span><s pan style="color: #19c518">, </span><span style="color: #e42e16">origin/HEAD</sp an><span style="color: #19c518">) </span><span style="color: #e7e71c">2014-04-10 </span> ~ Make ReflectorImpl use mailboxes<span style="font-weight: bold"></span ><span style="font-weight: bold; color: #ffffff"> &lt;(chap2, fix_typo)</span ><span style="font-weight: bold"></span><span style="font-weight: bold"></span>
1192 * <span style="font-weight: bold; color: #e42e16">41290e0 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ don 't use glibc-specific execinfo.h on uclibc builds
1193 * <span style="font-weight: bold; color: #e42e16">a76fde7 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ [fs p] Add requestUnmount() method together with the request manager.
1194 * <span style="font-weight: bold; color: #e42e16">9de7a71 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ lin ux_aura: Use system configuration for middle clicking the titlebar.
1195 * <span style="font-weight: bold; color: #e42e16">073b0c2 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Con tentView-&gt;ContentViewCore in ContentViewRenderView
1196 * <span style="font-weight: bold; color: #e42e16">2250f53 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ ozo ne: evdev: Filter devices by path
1197 * <span style="font-weight: bold; color: #e42e16">33a7a74 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Alw ays output seccomp error messages to stderr
1198 <span style="font-weight: bold; color: #ffffff">$ git cl upload -r domo@chromium .org --send-mail</span>
1199 ... truncated output ...
1200 </code></pre></div></div><p><div class="paragraph"> We poke a committer until th ey lgtm :)</p></div><div class="listingblock"><div class="content"><pre><code><s pan style="font-weight: bold; color: #ffffff">$ git cl set_commit</span>
1201 </code></pre></div></div><p><div class="paragraph"> While that runs through the CQ, let's get started on chapter 3. Since we know that chapter 3 depends on chap ter 2, we'll track the current chapter2 branch.</p></div><div class="listingbloc k"><div class="content"><pre><code><span style="font-weight: bold; color: #fffff f">$ git new-branch --upstream_current chap3</span>
1202 <span style="font-weight: bold; color: #ffffff">$ cat &gt;&gt; build/whitespace_ file.txt &lt;&lt;EOF</span>
1203
1204 CHAPTER 3:
1205 Mr. Usagi felt that something wasn't right. Shortly after the Domo-Kun left he
1206 began feeling sick.
1207 EOF
1208 <span style="font-weight: bold; color: #ffffff">$ git commit -am 'beginning of c hapter 3'</span>
1209 [chap3 7d4238a] beginning of chapter 3
1210 1 file changed, 4 insertions(+)
1211 <span style="font-weight: bold; color: #ffffff">$ git map</span>
1212 <span style="background-color: #492ee1"></span><span style="font-weight: bold; b ackground-color: #492ee1">* </span><span style="font-weight: bold; color: #e42e1 6; background-color: #492ee1">7d4238a </span><span style="color: #19c518"> (</ span><span style="color: #33d6e5"></span><span style="font-weight: bold; color: #33d6e5">chap3</span><span style="font-weight: bold"></span><span style="font-we ight: bold"></span><span style="color: #19c518">) </span><span style="color: #e7 e71c">2014-04-10</span> ~ beginning of chapter 3
1213 * <span style="font-weight: bold; color: #e42e16">ceef712 </span><span sty le="color: #19c518"> (</span><span style="color: #19c518"></span><span style="fo nt-weight: bold; color: #19c518">chap2</span><span style="font-weight: bold"></s pan><span style="font-weight: bold"></span><span style="color: #19c518">) </span ><span style="color: #e7e71c">2014-04-10</span> ~ Finish chapter 2<span style="f ont-weight: bold"></span><span style="font-weight: bold; color: #ffffff"> &lt ;(chap3)</span><span style="font-weight: bold"></span><span style="font-weight: bold"></span>
1214 <span style="color: #e42e16">|</span> * <span style="font-weight: bold; color: # e42e16">2c0ad9c </span><span style="color: #19c518"> (</span><span style="color: #19c518"></span><span style="font-weight: bold; color: #19c518">fix_typo</span> <span style="font-weight: bold"></span><span style="font-weight: bold"></span><s pan style="color: #19c518">) </span><span style="color: #e7e71c">2014-04-10</spa n> ~ Fix typo for good!
1215 <span style="color: #e42e16">|</span> * <span style="font-weight: bold; color: # e42e16">615ffa7 </span><span style="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Fix terrible typo.
1216 <span style="color: #e42e16">|</span><span style="color: #e42e16">/</span>
1217 * <span style="font-weight: bold; color: #e42e16">beec6f4 </span><span sty le="color: #19c518"> (</span><span style="color: #e42e16">origin/master</span><s pan style="color: #19c518">, </span><span style="color: #e42e16">origin/HEAD</sp an><span style="color: #19c518">) </span><span style="color: #e7e71c">2014-04-10 </span> ~ Make ReflectorImpl use mailboxes<span style="font-weight: bold"></span ><span style="font-weight: bold; color: #ffffff"> &lt;(chap2, fix_typo)</span ><span style="font-weight: bold"></span><span style="font-weight: bold"></span>
1218 * <span style="font-weight: bold; color: #e42e16">41290e0 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ don 't use glibc-specific execinfo.h on uclibc builds
1219 * <span style="font-weight: bold; color: #e42e16">a76fde7 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ [fs p] Add requestUnmount() method together with the request manager.
1220 * <span style="font-weight: bold; color: #e42e16">9de7a71 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ lin ux_aura: Use system configuration for middle clicking the titlebar.
1221 * <span style="font-weight: bold; color: #e42e16">073b0c2 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Con tentView-&gt;ContentViewCore in ContentViewRenderView
1222 * <span style="font-weight: bold; color: #e42e16">2250f53 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ ozo ne: evdev: Filter devices by path
1223 * <span style="font-weight: bold; color: #e42e16">33a7a74 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Alw ays output seccomp error messages to stderr
1224 </code></pre></div></div><p><div class="paragraph"> We haven't updated the code in a while, so let's do that now.</p></div><div class="listingblock"><div class= "content"><pre><code><span style="font-weight: bold; color: #ffffff">$ git rebas e-update</span>
1225 Fetching origin
1226 From /Users/iannucci/chromium/depot_tools/docs/src/demo_repo
1227 beec6f4..59cdb73 master -&gt; origin/master
1228 Rebasing: chap2
1229 Rebasing: fix_typo
1230 Failed! Attempting to squash fix_typo ... Success!
1231 Rebasing: chap3
1232 Deleted branch fix_typo (was 5d26fec).
1233 Reparented chap3 to track origin/master (was tracking chap2)
1234 Deleted branch chap2 (was 5d26fec).
1235 </code></pre></div></div><p><div class="paragraph"> Well look at that. The CQ la nded our typo and chapter2 branches already and git rebase-update cleaned them up for us.</p></div><div class="listingblock"><div class="content"><pre><code><s pan style="font-weight: bold; color: #ffffff">$ gclient sync</span>
1236 ... truncated output ...
1237 <span style="font-weight: bold; color: #ffffff">$ git map</span>
1238 <span style="background-color: #492ee1"></span><span style="font-weight: bold; b ackground-color: #492ee1">* </span><span style="font-weight: bold; color: #e42e1 6; background-color: #492ee1">93fe917 </span><span style="color: #19c518"> (</ span><span style="color: #33d6e5"></span><span style="font-weight: bold; color: #33d6e5">chap3</span><span style="font-weight: bold"></span><span style="font-we ight: bold"></span><span style="color: #19c518">) </span><span style="color: #e7 e71c">2014-04-10</span> ~ beginning of chapter 3
1239 * <span style="font-weight: bold; color: #e42e16">5d26fec </span><span sty le="color: #19c518"> (</span><span style="color: #e42e16">origin/master</span><s pan style="color: #19c518">, </span><span style="color: #e42e16">origin/HEAD</sp an><span style="color: #19c518">) </span><span style="color: #e7e71c">2014-04-10 </span> ~ Finish chapter 2<span style="font-weight: bold"></span><span style="fo nt-weight: bold; color: #ffffff"> &lt;(chap3)</span><span style="font-weight: bold"></span><span style="font-weight: bold"></span>
1240 * <span style="font-weight: bold; color: #e42e16">df7fefb </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Rev ert 255617, due to it not tracking use of the link doctor page properly.
1241 * <span style="font-weight: bold; color: #e42e16">4b39cda </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Fix terrible typo.
1242 * <span style="font-weight: bold; color: #e42e16">248c5b6 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Tem porarily CHECK(trial) in ChromeRenderProcessObserver::OnSetFieldTrialGroup.
1243 * <span style="font-weight: bold; color: #e42e16">8171df8 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Rem ove AMD family check for the flapper crypto accelerator.
1244 * <span style="font-weight: bold; color: #e42e16">d6a30d2 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Cha nge the Pica load benchmark to listen for the polymer-ready event
1245 * <span style="font-weight: bold; color: #e42e16">beec6f4 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Mak e ReflectorImpl use mailboxes
1246 * <span style="font-weight: bold; color: #e42e16">41290e0 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ don 't use glibc-specific execinfo.h on uclibc builds
1247 * <span style="font-weight: bold; color: #e42e16">a76fde7 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ [fs p] Add requestUnmount() method together with the request manager.
1248 * <span style="font-weight: bold; color: #e42e16">9de7a71 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ lin ux_aura: Use system configuration for middle clicking the titlebar.
1249 * <span style="font-weight: bold; color: #e42e16">073b0c2 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Con tentView-&gt;ContentViewCore in ContentViewRenderView
1250 * <span style="font-weight: bold; color: #e42e16">2250f53 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ ozo ne: evdev: Filter devices by path
1251 * <span style="font-weight: bold; color: #e42e16">33a7a74 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Alw ays output seccomp error messages to stderr
1252 </code></pre></div></div><p><div class="paragraph"> Someone on IRC mentions that they actually landed a chapter 3 already! We should pull their changes before c ontinuing. Brace for a code conflict!</p></div><div class="listingblock"><div cl ass="content"><pre><code><span style="font-weight: bold; color: #ffffff">$ git r ebase-update</span>
1253 Fetching origin
1254 From /Users/iannucci/chromium/depot_tools/docs/src/demo_repo
1255 5d26fec..59cdb73 master -&gt; origin/master
1256 Rebasing: chap2
1257 ... lots of output, it's a conflict alright :(...
1258 <span style="font-weight: bold; color: #ffffff">$ git diff</span>
1259 <span style="font-weight: bold">diff --cc build/whitespace_file.txt</span>
1260 <span style="font-weight: bold">index 1293282,f903ea2..0000000</span>
1261 <span style="font-weight: bold">--- a/build/whitespace_file.txt</span>
1262 <span style="font-weight: bold">+++ b/build/whitespace_file.txt</span>
1263 <span style="color: #33d6e5">@@@ -42,4 -42,5 +42,9 @@@</span> when the fan was l ast cleaned
1264 There was an poignant pause.
1265
1266 CHAPTER 3:
1267 <span style="color: #19c518">++&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD</span>
1268 <span style="color: #19c518"> +Hilariousness! This chapter is awesome!</span>
1269 <span style="color: #19c518">++=======</span>
1270 <span style="color: #19c518">+ Mr. Usagi felt that something wasn't right. Short ly after the Domo-Kun left he</span>
1271 <span style="color: #19c518">+ began feeling sick.</span>
1272 <span style="color: #19c518">++&gt;&gt;&gt;&gt;&gt;&gt;&gt; beginning of chapter 3</span>
1273 </code></pre></div></div><p><div class="paragraph"> Oh, well, that's not too bad . In fact... that's a terrible chapter 3!</p></div><div class="listingblock"><di v class="content"><pre><code><span style="font-weight: bold; color: #ffffff">$ $ EDITOR build/whitespace_file.txt</span>
1274 ... /me deletes bad chapter 3 ...
1275 <span style="font-weight: bold; color: #ffffff">$ git add build/whitespace_file. txt</span>
1276 <span style="font-weight: bold; color: #ffffff">$ git diff --cached</span>
1277 <span style="font-weight: bold">diff --git a/build/whitespace_file.txt b/build/w hitespace_file.txt</span>
1278 <span style="font-weight: bold">index 1293282..f903ea2 100644</span>
1279 <span style="font-weight: bold">--- a/build/whitespace_file.txt</span>
1280 <span style="font-weight: bold">+++ b/build/whitespace_file.txt</span>
1281 <span style="color: #33d6e5">@@ -42,4 +42,5 @@</span> when the fan was last clea ned.
1282 There was an poignant pause.
1283
1284 CHAPTER 3:
1285 <span style="color: #e42e16">-Hilariousness! This chapter is awesome!</span>
1286 <span style="color: #19c518">+</span><span style="color: #19c518">Mr. Usagi felt that something wasn't right. Shortly after the Domo-Kun left he</span>
1287 <span style="color: #19c518">+</span><span style="color: #19c518">began feeling sick.</span>
1288 </code></pre></div></div><p><div class="paragraph"> Much better</p></div><div cl ass="listingblock"><div class="content"><pre><code><span style="font-weight: bol d; color: #ffffff">$ git rebase --continue</span>
1289 Applying: beginning of chapter 3
1290 <span style="font-weight: bold; color: #ffffff">$ git rebase-update</span>
1291 Fetching origin
1292 chap3 up-to-date
1293 <span style="font-weight: bold; color: #ffffff">$ gclient sync</span>
1294 ... truncated output ...
1295 <span style="font-weight: bold; color: #ffffff">$ git map</span>
1296 <span style="background-color: #492ee1"></span><span style="font-weight: bold; b ackground-color: #492ee1">* </span><span style="font-weight: bold; color: #e42e1 6; background-color: #492ee1">1cb4f5b </span><span style="color: #19c518"> (</ span><span style="color: #33d6e5"></span><span style="font-weight: bold; color: #33d6e5">chap3</span><span style="font-weight: bold"></span><span style="font-we ight: bold"></span><span style="color: #19c518">) </span><span style="color: #e7 e71c">2014-04-10</span> ~ beginning of chapter 3
1297 * <span style="font-weight: bold; color: #e42e16">59cdb73 </span><span sty le="color: #19c518"> (</span><span style="color: #e42e16">origin/master</span><s pan style="color: #19c518">, </span><span style="color: #e42e16">origin/HEAD</sp an><span style="color: #19c518">) </span><span style="color: #e7e71c">2014-04-10 </span> ~ Refactor data interchange format.<span style="font-weight: bold"></spa n><span style="font-weight: bold; color: #ffffff"> &lt;(chap3)</span><span st yle="font-weight: bold"></span><span style="font-weight: bold"></span>
1298 * <span style="font-weight: bold; color: #e42e16">34676a3 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Ens ure FS is exited for all not-in-same-page navigations.
1299 * <span style="font-weight: bold; color: #e42e16">7d4784e </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Add best chapter2 ever!
1300 * <span style="font-weight: bold; color: #e42e16">5d26fec </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Fin ish chapter 2
1301 * <span style="font-weight: bold; color: #e42e16">df7fefb </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Rev ert 255617, due to it not tracking use of the link doctor page properly.
1302 * <span style="font-weight: bold; color: #e42e16">4b39cda </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Fix terrible typo.
1303 * <span style="font-weight: bold; color: #e42e16">248c5b6 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Tem porarily CHECK(trial) in ChromeRenderProcessObserver::OnSetFieldTrialGroup.
1304 * <span style="font-weight: bold; color: #e42e16">8171df8 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Rem ove AMD family check for the flapper crypto accelerator.
1305 * <span style="font-weight: bold; color: #e42e16">d6a30d2 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Cha nge the Pica load benchmark to listen for the polymer-ready event
1306 * <span style="font-weight: bold; color: #e42e16">beec6f4 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Mak e ReflectorImpl use mailboxes
1307 * <span style="font-weight: bold; color: #e42e16">41290e0 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ don 't use glibc-specific execinfo.h on uclibc builds
1308 * <span style="font-weight: bold; color: #e42e16">a76fde7 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ [fs p] Add requestUnmount() method together with the request manager.
1309 * <span style="font-weight: bold; color: #e42e16">9de7a71 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ lin ux_aura: Use system configuration for middle clicking the titlebar.
1310 * <span style="font-weight: bold; color: #e42e16">073b0c2 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Con tentView-&gt;ContentViewCore in ContentViewRenderView
1311 * <span style="font-weight: bold; color: #e42e16">2250f53 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ ozo ne: evdev: Filter devices by path
1312 * <span style="font-weight: bold; color: #e42e16">33a7a74 </span><span sty le="color: #19c518"></span> <span style="color: #e7e71c">2014-04-10</span> ~ Alw ays output seccomp error messages to stderr
1313 <span style="font-weight: bold; color: #ffffff">$ git cl upload</span>
1314 ... truncated output ...
1315 </code></pre></div></div><p><div class="paragraph"></p></div>
1316 <div class="paragraph"><p>So there you have the basic flow. Note that you don&#8 217;t <em>have</em> to do chromium
1317 development using these tools. Any git workflow is compatible, as long as
1318 <code>git cl upload</code> is able to upload good patches.</p></div>
1319 </div>
1320 </div>
1321 <div class="sect1">
1322 <h2 id="_creating_uploading_a_cl">CREATING / UPLOADING A CL</h2>
1323 <div class="sectionbody">
1324 <div class="admonitionblock">
1325 <table><tr>
1326 <td class="icon">
1327 <div class="title">Note</div>
1328 </td>
1329 <td class="content">The remainder of the tutorial assumes that your current work ing directory
1330 is the <code>src/</code> folder mentioned in <a href="#_getting_the_code">Gettin g the code</a>.</td>
1331 </tr></table>
1332 </div>
1333 <div class="paragraph"><p>Each CL corresponds exactly with a single branch in gi t. Any time you want to
1334 begin a new CL, just:</p></div>
1335 <div class="listingblock">
1336 <div class="content">
1337 <pre><code><strong><span class="white">$ git new-branch &lt;branch_name&gt;</spa n></strong></code></pre>
1338 </div></div>
1339 <div class="paragraph"><p>This will create and checkout a new branch named <code >branch_name</code> which will track
1340 the default upstream (which is <code>origin/master</code>). See <a href="git-new -branch.html">git-new-branch(1)</a>
1341 for more features, such as the ability to track <em>LKGR</em>.</p></div>
1342 <div class="paragraph"><p>Commit as many changes as you like to this branch. Whe n you want to upload it
1343 for review, run:</p></div>
1344 <div class="listingblock">
1345 <div class="content">
1346 <pre><code><strong><span class="white">$ git cl upload</span></strong></code></p re>
1347 </div></div>
1348 <div class="paragraph"><p>This will take the diff of your branch against its ups tream (<code>origin/master</code>),
1349 and will post it to the <a href="https://codereview.chromium.org">Chromium code
1350 review site</a>.</p></div>
1351 </div>
1352 </div>
1353 <div class="sect1">
1354 <h2 id="_updating_the_code">UPDATING THE CODE</h2>
1355 <div class="sectionbody">
1356 <div class="paragraph"><p>Inevitably, you&#8217;ll want to pull in changes from the main Chromium repo. This is
1357 pretty easy with <em>depot_tools</em>:</p></div>
1358 <div class="listingblock">
1359 <div class="content">
1360 <pre><code><strong><span class="white">$ git rebase-update</span></strong></code ></pre>
1361 </div></div>
1362 <div class="paragraph"><p>This command will update all of your CLs to contain th e latest code from their
1363 upstreams. It will also automatically clean up CLs which have been committed and
1364 a couple other nice things. See <a href="git-rebase-update.html">git-rebase-upda te(1)</a> for the full
1365 scoop.</p></div>
1366 <div class="paragraph"><p>One thing to look out for are <em>merge conflicts</em> . These happen for exactly the
1367 same as they do with SVN, but the experience is a little more controllable with
1368 git. <code>git rebase-update</code> will try to rebase all your branches for you , but if it
1369 encounters a merge conflict in one, it will halt and leave you in a rebase
1370 conflict state (see <a href="git-rebase.html">git-rebase(1)</a>). Resolving <cod e>git rebase</code> merge
1371 conflicts is beyond the scope of this tutorial, but there are many good sources
1372 online (see the <a href="#_prerequisites">Prerequisites</a> for some).</p></div>
1373 <div class="paragraph"><p>Sometimes you&#8217;re pretty certain that you&#8217;v e committed a certain branch, but <code>git
1374 rebase-update</code> isn&#8217;t able to tell that for sure. This is usually bec ause your
1375 branch doesn&#8217;t rebase cleanly. You could just delete the branch with <code >git branch
1376 -D &lt;branch&gt;</code>, but you&#8217;d like to double check the diff of your branch against its
1377 upstream before deleting it. If this is the case you can abort the rebase
1378 started by <code>git rebase-update</code>, and then run <a href="git-squash-bran ch.html">git-squash-branch(1)</a> to
1379 flatten your branch into a single commit. When you run <code>git rebase-update</ code>
1380 again, you&#8217;ll get a (hopefully) much smaller / saner diff. If it turns out you
1381 were wrong about your branch being fully committed, you can use
1382 <a href="git-reflog.html">git-reflog(1)</a> to reset your branch back to where i t was before. If the
1383 diff looks inconsequential, you can use <code>git rebase --skip</code> to ignore it, and
1384 then <code>git rebase-update</code> will clean it up for you.</p></div>
1385 <div class="paragraph"><p>Once you&#8217;re done resolving all of the merge conf lict, just run <code>git
1386 rebase-update</code>, and it will pick up where it left off. Once the command ha s
1387 finished updating all of your branches, it will return you back to the branch
1388 you started on.</p></div>
1389 <div class="admonitionblock">
1390 <table><tr>
1391 <td class="icon">
1392 <div class="title">Note</div>
1393 </td>
1394 <td class="content">Running <code>git rebase-update</code> will update all your branches, but it will not
1395 automatically run <code>gclient sync</code> to update your dependencies.</td>
1396 </tr></table>
1397 </div>
1398 </div>
1399 </div>
1400 <div class="sect1">
1401 <h2 id="_managing_multiple_cls">MANAGING MULTIPLE CLS</h2>
1402 <div class="sectionbody">
1403 <div class="paragraph"><p>Sometimes you want to work on more than one CL at once (say, you have a CL
1404 posted for review and want to work on something else). For each CL that you
1405 want to work on, just use <code>git new-branch &lt;branchname&gt;</code>.</p></d iv>
1406 <div class="paragraph"><p>Once you start to have more than one CL at a time, it can be easy to lose your
1407 bearings. Fortunately, <em>depot_tools</em> has two tools to help you out:</p></ div>
1408 <div class="listingblock">
1409 <div class="content">
1410 <pre><code><strong><span class="white">$ git map</span></strong>
1411 <span class="white blue-background">*</span>&#8203;<strong><span class="blue-bac kground red"> 7dcfe47 </span></strong> <span class="green">(</span>&#8203; <strong><span class="aqua">frozen_changes</span></strong>&#8203;<span class="gre en">)</span> <span class="yellow">2014-03-12</span> ~ FREEZE.unindexed
1412 * <strong><span class="red">4b0c180</span></strong> <span class="yellow"> 2014-03-12</span> ~ modfile
1413 * <strong><span class="red">59a7cca</span></strong> <span class="yellow"> 2014-03-12</span> ~ a deleted file
1414 * <strong><span class="red">6bec695</span></strong> <span class="green">( </span>&#8203;<span class="red">origin/master</span>&#8203;<span class="green">) </span> <span class="yellow">2014-03-11</span> ~ Add neat feature <strong><sp an class="white">&lt;(frozen_changes)</span></strong>
1415 * <strong><span class="red">d15a38a</span></strong> <span class="yellow"> 2014-03-11</span> ~ Epic README update
1416 * <strong><span class="red">d559894</span></strong> <span class="green">( </span>&#8203;<strong><span class="lime">master</span></strong>&#8203;<span clas s="green">)</span> <span class="yellow">2014-03-11</span> ~ Important upstream c hange
1417 <span class="red">|</span> * <strong><span class="red">9c311fd</span></strong> <span class="green">(</span>&#8203;<strong><span class="lime">cool_feature</ span></strong>&#8203;<span class="green">)</span> <span class="yellow">2014-03-1 1</span> ~ Respond to CL comments
1418 <span class="red">|</span> <span class="green">|</span> * <strong><span class="r ed">2a1eeb2</span></strong> <span class="green">(</span>&#8203;<strong><span class="lime">subfeature</span></strong>&#8203;<span class="green">)</span> <span class="yellow">2014-03-11</span> ~ integrate with CoolService
1419 <span class="red">|</span> <span class="green">|</span> * <strong><span class="r ed">d777af6</span></strong> <span class="yellow">2014-03-11</span> ~ slick co mmenting action
1420 <span class="red">|</span> <span class="green">|/</span>
1421 <span class="red">|</span> * <strong><span class="red">265803a</span></strong> <span class="yellow">2014-03-11</span> ~ another improvement <strong><spa n class="white">&lt;(subfeature)</span></strong>
1422 <span class="red">|</span> * <strong><span class="red">6d831ac</span></strong> <span class="green">(</span>&#8203;<strong><span class="fuchsia">spleen_tag< /span></strong>&#8203;<span class="green">)</span> <span class="yellow">2014-03- 11</span> ~ Refactor spleen
1423 <span class="red">|</span> * <strong><span class="red">82e74ab</span></strong> <span class="yellow">2014-03-11</span> ~ Add widget
1424 <span class="red">|/</span>
1425 * <strong><span class="red">d08c5b3</span></strong> <span class="green">( </span>&#8203;<strong><span class="lime">bogus_noparent</span></strong>&#8203;<s pan class="green">)</span> <span class="yellow">2014-03-11</span> ~ Wonderful be ginnings <strong><span class="white">&lt;(cool_feature)</span></strong></code ></pre>
1426 </div></div>
1427 <div class="paragraph"><p>Note that this example repo is in dire need of a <a hr ef="git-rebase-update.html">git-rebase-update(1)</a>!</p></div>
1428 <div class="listingblock">
1429 <div class="content">
1430 <pre><code><strong><span class="white">$ git map-branches</span></strong>
1431 <span class="red">origin/master</span>
1432 <span class="green">cool_feature</span>
1433 <span class="green">subfeature</span>
1434 <span class="aqua">frozen_changes *</span>
1435 <span class="green">master</span></code></pre>
1436 </div></div>
1437 <div class="dlist"><dl>
1438 <dt class="hdlist1">
1439 <a href="git-map.html">git-map(1)</a>
1440 </dt>
1441 <dd>
1442 <p>
1443 This tool shows you the history of all of your branches in a pseudo-graphical
1444 format. In particular, it will show you which commits all of your branches
1445 are on, which commit you currently have checked out, and more. Check out the
1446 doc for the full details.
1447 </p>
1448 </dd>
1449 <dt class="hdlist1">
1450 <a href="git-map-branches.html">git-map-branches(1)</a>
1451 </dt>
1452 <dd>
1453 <p>
1454 This tool just shows you which branches you have in your repo, and thier
1455 upstream relationship to each other (as well as which branch you have checked
1456 out at the moment).
1457 </p>
1458 </dd>
1459 </dl></div>
1460 <div class="paragraph"><p>Additionally, sometimes you need to switch between bra nches, but you&#8217;ve got work
1461 in progress. You could use <a href="git-stash.html">git-stash(1)</a>, but that c an be tricky to
1462 manage because you need to remember which branches you stashed what changes on.
1463 Helpfully <em>depot_tools</em> includes two tools which can greatly assist in ca se:</p></div>
1464 <div class="paragraph"><p><a href="git-freeze.html">git-freeze(1)</a> allows you to put the current branch in 'suspended
1465 animation' by committing your changes to a specially-named commit on the top of
1466 your current branch. When you come back to your branch later, you can just run
1467 <a href="git-thaw.html">git-thaw(1)</a> to get your work-in-progress changes bac k to what they were.</p></div>
1468 <div class="paragraph"><p>Another useful tool is <a href="git-rename-branch.html ">git-rename-branch(1)</a>. Unlike <code>git branch -m &lt;old&gt;
1469 &lt;new&gt;</code>, this tool will correctly preserve the upstream relationships of your
1470 branch compared to its downstreams.</p></div>
1471 <div class="paragraph"><p>Finally, take a look at <a href="git-upstream-diff.htm l">git-upstream-diff(1)</a>. This will show you the
1472 combined diff for all the commits on your branch against the upstream tracking
1473 branch. This is <em>exactly</em> what <code>git cl upload</code> will push up to code review.
1474 Additionally, consider trying the <code>--wordwise</code> argument to get a colo rized
1475 per-word diff (instead of a per-line diff).</p></div>
1476 </div>
1477 </div>
1478 <div class="sect1">
1479 <h2 id="_managing_dependent_cls">MANAGING DEPENDENT CLS</h2>
1480 <div class="sectionbody">
1481 <div class="paragraph"><p>Now that you know how to manage <em>independent</em> C Ls, we&#8217;ll see how to manage
1482 <em>dependent</em> CLs. Dependent CLs are useful when your second (or third or f ourth
1483 or &#8230;) CL depends on the changes in one of your other CLs (such as: CL 2 wo n&#8217;t
1484 compile without CL 1, but you want to submit them as two separate reviews).</p>< /div>
1485 <div class="paragraph"><p>Like all of the other CLs we&#8217;ve created, we use <a href="git-new-branch.html">git-new-branch(1)</a>, but
1486 this time with an extra argument. First, <code>git checkout</code> the branch
1487 you want to base the new one on (i.e. CL 1), and then run:</p></div>
1488 <div class="listingblock">
1489 <div class="content">
1490 <pre><code><strong><span class="white">$ git new-branch --upstream_current &lt;b ranch_name&gt;</span></strong></code></pre>
1491 </div></div>
1492 <div class="paragraph"><p>This will make a new branch which tracks the <em>curre nt</em> branch as its upstream
1493 (as opposed to <em>origin/master</em>). All changes you commit to this branch wi ll be
1494 in addition to the previous branch, but when you <code>git cl upload</code>, you will only
1495 upload the diff for the dependent (child) branch. You may have as many branches
1496 nested in this fashion as you like.</p></div>
1497 <div class="paragraph"><p><a href="git-map.html">git-map(1)</a> and <a href="git -map-branches.html">git-map-branches(1)</a> are particularly helpful when
1498 you have dependent branches. In addition, there are two helper commands which
1499 let you traverse your working copy up and down this tree of branches:
1500 <a href="git-nav-upstream.html">git-nav-upstream(1)</a> and <a href="git-nav-dow nstream.html">git-nav-downstream(1)</a>.</p></div>
1501 <div class="paragraph"><p>Sometimes when dealing with dependent CLs, it turns ou t that you accidentally
1502 based a branch on the wrong upstream, but since then you&#8217;ve committed chan ges to
1503 it, or even based <em>another</em> branch off of that one. Or you discover that you
1504 have two independent CLs that would actually be much better off as dependent
1505 CLs. In instances like these, you can check out the offending branch and use
1506 <a href="git-reparent-branch.html">git-reparent-branch(1)</a> to move it to trac k a different parent. Note that
1507 this can also be used to move a branch from tracking <code>origin/master</code> to <code>lkgr</code>
1508 or vice versa.</p></div>
1509 </div>
1510 </div>
1511 <div class="sect1">
1512 <h2 id="_conclusion">CONCLUSION</h2>
1513 <div class="sectionbody">
1514 <div class="paragraph"><p>Hopefully that gives you a good starting overview on C hromium development using
1515 <em>depot_tools</em>. If you have questions which weren&#8217;t answered by this tutorial or
1516 the man pages for the tools (see the index of all tools here:
1517 <a href="depot_tools.html">depot_tools(7)</a>), please feel free to ask.</p></di v>
1518 </div>
1519 </div>
1520 <div class="sect1">
1521 <h2 id="_glossary">GLOSSARY</h2>
1522 <div class="sectionbody">
1523 <div class="dlist"><dl>
1524 <dt class="hdlist1">
1525 CL
1526 </dt>
1527 <dd>
1528 <p>
1529 A <em>change-list</em>. This is a diff which you would like to commit to the
1530 codebase.
1531 </p>
1532 </dd>
1533 <dt class="hdlist1">
1534 DEPS
1535 </dt>
1536 <dd>
1537 <p>
1538 A file in the chromium checkout which <code>gclient sync</code> uses to determ ine what
1539 dependencies to pull in. This file also contains <em>hooks</em>.
1540 </p>
1541 </dd>
1542 <dt class="hdlist1">
1543 LKGR
1544 </dt>
1545 <dd>
1546 <p>
1547 Last Known Good Revision. This is a <a href="git-tag.html">git-tag(1)</a> whic h tracks the last
1548 version of <code>origin/master</code> which has passed the full set of testing on the
1549 <a href="http://build.chromium.org">main Chromium waterfall</a>.
1550 </p>
1551 </dd>
1552 </dl></div>
1553 </div>
1554 </div>
1555 <div class="sect1">
1556 <h2 id="_chromium_depot_tools">CHROMIUM DEPOT_TOOLS</h2>
1557 <div class="sectionbody">
1558 <div class="paragraph"><p>Part of the chromium <a href="depot_tools.html">depot_ tools(7)</a> suite. These tools are meant to
1559 assist with the development of chromium and related projects. Download the tools
1560 from <a href="https://chromium.googlesource.com/chromium/tools/depot_tools.git"> here</a>.</p></div>
1561 </div>
1562 </div>
1563 </div>
1564 <div id="footnotes"><hr /></div>
1565 <div id="footer">
1566 <div id="footer-text">
1567 Last updated 2014-04-10 21:30:33 PDT
1568 </div>
1569 </div>
1570 </body>
1571 </html>
OLDNEW
« no previous file with comments | « docs/html/depot_tools.html ('k') | docs/html/git-freeze.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698