depot_tools_tutorial.7 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101
  1. '\" t
  2. .\" Title: depot_tools_tutorial
  3. .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
  4. .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
  5. .\" Date: 08/26/2022
  6. .\" Manual: Chromium depot_tools Manual
  7. .\" Source: depot_tools 59e95c91
  8. .\" Language: English
  9. .\"
  10. .TH "DEPOT_TOOLS_TUTORIAL" "7" "08/26/2022" "depot_tools 59e95c91" "Chromium depot_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 tools which are designed to work together to enable anyone to wrangle the Chromium codebase expertly\&. This tutorial explains how to do development on Chromium using 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
  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. .RS 4
  114. .ie n \{\
  115. \h'-04'\(bu\h'+03'\c
  116. .\}
  117. .el \{\
  118. .sp -1
  119. .IP \(bu 2.3
  120. .\}
  121. Example Walkthrough
  122. .RE
  123. .sp
  124. Please refer to the manpages (or \fB\-\-help\fR output) for details about any of the commands mentioned in this tutorial\&.
  125. .if n \{\
  126. .sp
  127. .\}
  128. .RS 4
  129. .it 1 an-trap
  130. .nr an-no-space-flag 1
  131. .nr an-break-flag 1
  132. .br
  133. .ps +1
  134. \fBNote\fR
  135. .ps -1
  136. .br
  137. .sp
  138. If your platform does not support manpages (or you prefer something a bit more expressive than plain text) you can find all documentation in \fIhtml\fR form in the \fB[DEPOT_TOOLS]/man/html\fR folder\&.
  139. .sp .5v
  140. .RE
  141. .SS "PREREQUISITES"
  142. .sp
  143. This tutorial assumes basic familiarity with git terminology and concepts\&. If you need to brush up on these, the following are very good resources:
  144. .sp
  145. .RS 4
  146. .ie n \{\
  147. \h'-04'\(bu\h'+03'\c
  148. .\}
  149. .el \{\
  150. .sp -1
  151. .IP \(bu 2.3
  152. .\}
  153. \m[blue]\fBThink like (a) Git\fR\m[]\&\s-2\u[1]\d\s+2
  154. \- A lighthearted overview of git\&. If you\(cqre sorta\-familiar with git, but not
  155. \fIcomfortable\fR
  156. with it, then give this a look\&.
  157. .RE
  158. .sp
  159. .RS 4
  160. .ie n \{\
  161. \h'-04'\(bu\h'+03'\c
  162. .\}
  163. .el \{\
  164. .sp -1
  165. .IP \(bu 2.3
  166. .\}
  167. \m[blue]\fBGit Immersion Tutorial\fR\m[]\&\s-2\u[2]\d\s+2
  168. \- An in\-depth git tutorial\&.
  169. .RE
  170. .sp
  171. .RS 4
  172. .ie n \{\
  173. \h'-04'\(bu\h'+03'\c
  174. .\}
  175. .el \{\
  176. .sp -1
  177. .IP \(bu 2.3
  178. .\}
  179. \m[blue]\fBpcottle\(cqs Visual Git Branching\fR\m[]\&\s-2\u[3]\d\s+2
  180. \- An excellent interactive/graphical demo on how git handles commits, branches, and shows the operations git performs on them\&.
  181. .RE
  182. .sp
  183. .RS 4
  184. .ie n \{\
  185. \h'-04'\(bu\h'+03'\c
  186. .\}
  187. .el \{\
  188. .sp -1
  189. .IP \(bu 2.3
  190. .\}
  191. \m[blue]\fBPro Git book\fR\m[]\&\s-2\u[4]\d\s+2
  192. \- \(lqThe\(rq book for learning git from basics to advanced concepts\&. A bit dry, but very through\&.
  193. .RE
  194. .sp
  195. 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 \fIreally\fR \fB\fIreally\fR\fR stuck, then chat up one of the Chromium infrastructure team members for some pointers\&.
  196. .PP
  197. Litmus Test
  198. .RS 4
  199. If you know what
  200. \fBgit add\fR,
  201. \fBgit status\fR,
  202. \fBgit commit\fR
  203. do and you know
  204. \fIessentially\fR
  205. what
  206. \fBgit rebase\fR
  207. does, then you should know enough to follow along\&.
  208. .RE
  209. .SH "SETTING UP"
  210. .SS "GET DEPOT TOOLS"
  211. .sp
  212. Clone the \fIdepot_tools\fR repository:
  213. .sp
  214. .if n \{\
  215. .RS 4
  216. .\}
  217. .nf
  218. \fB$ git clone https://chromium\&.googlesource\&.com/chromium/tools/depot_tools\&.git\fR
  219. .fi
  220. .if n \{\
  221. .RE
  222. .\}
  223. .sp
  224. .sp
  225. Add \fIdepot_tools\fR to the \fIfront\fR of your PATH (you will probably want to put this in your \fB~/\&.bashrc\fR or \fB~/\&.zshrc\fR)\&. Assuming you cloned \fIdepot_tools\fR to \fB/path/to/depot_tools\fR:
  226. .sp
  227. .if n \{\
  228. .RS 4
  229. .\}
  230. .nf
  231. \fB$ export PATH=/path/to/depot_tools:$PATH\fR
  232. .fi
  233. .if n \{\
  234. .RE
  235. .\}
  236. .sp
  237. .SS "BOOTSTRAPPING CONFIGURATION"
  238. .sp
  239. If you have never used git before, you\(cqll need to set some global git configurations; substitute your name and email address in the following commands:
  240. .sp
  241. .if n \{\
  242. .RS 4
  243. .\}
  244. .nf
  245. \fB$ git config \-\-global user\&.name "John Doe"\fR
  246. \fB$ git config \-\-global user\&.email "jdoe@email\&.com"\fR
  247. \fB$ git config \-\-global core\&.autocrlf false\fR
  248. \fB$ git config \-\-global core\&.filemode false\fR
  249. \fB$\fR # and for fun!
  250. \fB$ git config \-\-global color\&.ui true\fR
  251. .fi
  252. .if n \{\
  253. .RE
  254. .\}
  255. .sp
  256. .SH "TL;DR"
  257. .sp
  258. .if n \{\
  259. .RS 4
  260. .\}
  261. .nf
  262. \fB$\fR # get the code
  263. \fB$\fR # In an empty directory:
  264. \fB$ fetch {chromium,\&.\&.\&.}\fR
  265. \fB$\fR # Update third_party repos and run pre\-compile hooks
  266. \fB$ gclient sync\fR
  267. \fB$\fR # Make a new change and upload it for review
  268. \fB$ git new\-branch <branch_name>\fR
  269. \fB$\fR # repeat: [edit, git add, git commit]
  270. \fB$ git cl upload\fR
  271. \fB$\fR # After change is reviewed, commit with the CQ
  272. \fB$ git cl set_commit\fR
  273. \fB$\fR # Note that the committed hash which lands will /not/ match the
  274. \fB$\fR # commit hashes of your local branch\&.
  275. .fi
  276. .if n \{\
  277. .RE
  278. .\}
  279. .sp
  280. .SH "GETTING THE CODE"
  281. .sp
  282. Pick an empty directory and run one of the following:
  283. .sp
  284. .if n \{\
  285. .RS 4
  286. .\}
  287. .nf
  288. \fB$ fetch chromium\fR # Basic checkout for desktop Chromium
  289. \fB$ fetch android\fR # Chromium checkout for Android platform
  290. \fB$ fetch ios\fR # Chromium checkout for iOS platform
  291. .fi
  292. .if n \{\
  293. .RE
  294. .\}
  295. .sp
  296. .sp
  297. When the \fBfetch\fR tool completes you should have the following in your working directory:
  298. .sp
  299. .if n \{\
  300. .RS 4
  301. .\}
  302. .nf
  303. \fB\&.gclient\fR # A configuration file for you source checkout
  304. \fBsrc/\fR # Top\-level Chromium source checkout\&.
  305. .fi
  306. .if n \{\
  307. .RE
  308. .\}
  309. .sp
  310. .sp
  311. If you are on linux and fetching the code for the first time, then you\(cqll need to run:
  312. .sp
  313. .if n \{\
  314. .RS 4
  315. .\}
  316. .nf
  317. \fB$ cd src && \&./build/install\-build\-deps\&.sh\fR
  318. .fi
  319. .if n \{\
  320. .RE
  321. .\}
  322. .sp
  323. .sp
  324. And finally:
  325. .sp
  326. .if n \{\
  327. .RS 4
  328. .\}
  329. .nf
  330. \fB$ gclient sync\fR
  331. .fi
  332. .if n \{\
  333. .RE
  334. .\}
  335. .sp
  336. .sp
  337. This will pull all dependencies of the Chromium src checkout\&. You will need to run this any time you update the main src checkout, including when you switch branches\&.
  338. .SH "CREATING / UPLOADING A CL"
  339. .if n \{\
  340. .sp
  341. .\}
  342. .RS 4
  343. .it 1 an-trap
  344. .nr an-no-space-flag 1
  345. .nr an-break-flag 1
  346. .br
  347. .ps +1
  348. \fBNote\fR
  349. .ps -1
  350. .br
  351. .sp
  352. The remainder of the tutorial assumes that your current working directory is the \fBsrc/\fR folder mentioned in Getting the code\&.
  353. .sp .5v
  354. .RE
  355. .sp
  356. Each CL corresponds exactly with a single branch in git\&. Any time you want to begin a new CL:
  357. .sp
  358. .if n \{\
  359. .RS 4
  360. .\}
  361. .nf
  362. \fB$ git new\-branch <branch_name>\fR
  363. .fi
  364. .if n \{\
  365. .RE
  366. .\}
  367. .sp
  368. .sp
  369. This will create and checkout a new branch named \fBbranch_name\fR which will track the default upstream branch (\fBorigin/main\fR)\&. See \fBgit-new-branch\fR(1) for more features\&.
  370. .sp
  371. Commit as many changes as you like to this branch\&. When you want to upload it for review, run:
  372. .sp
  373. .if n \{\
  374. .RS 4
  375. .\}
  376. .nf
  377. \fB$ git cl upload\fR
  378. .fi
  379. .if n \{\
  380. .RE
  381. .\}
  382. .sp
  383. .sp
  384. This will take the diff of your branch against its upstream branch (in that case origin/main), and will post it to the \m[blue]\fBChromium code review site\fR\m[]\&\s-2\u[5]\d\s+2\&.
  385. .SH "UPDATING THE CODE"
  386. .sp
  387. Inevitably, you\(cqll want to pull in changes from the main Chromium repo\&. This is pretty easy with \fIdepot_tools\fR:
  388. .sp
  389. .if n \{\
  390. .RS 4
  391. .\}
  392. .nf
  393. \fB$ git rebase\-update\fR
  394. .fi
  395. .if n \{\
  396. .RE
  397. .\}
  398. .sp
  399. .sp
  400. This command will update all of your CLs to contain the latest code from their upstreams\&. It will also automatically clean up CLs which have been committed and a couple other nice things\&. See \fBgit-rebase-update\fR(1) for the full scoop\&.
  401. .sp
  402. 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 with git\&. \fBgit rebase\-update\fR 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 \fBgit rebase\fR merge conflicts is beyond the scope of this tutorial, but there are many good sources online (see the Prerequisites for some)\&.
  403. .sp
  404. Sometimes you\(cqre pretty certain that you\(cqve committed a certain branch, but \fBgit rebase\-update\fR isn\(cqt able to tell that for sure\&. This is usually because your branch doesn\(cqt rebase cleanly\&. You could just delete the branch with \fBgit branch \-D <branch>\fR, but you\(cqd like to double check the diff of your branch against its upstream before deleting it\&. If this is the case you can abort the rebase started by \fBgit rebase\-update\fR, and then run \fBgit-squash-branch\fR(1) to flatten your branch into a single commit\&. When you run \fBgit rebase\-update\fR 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-reflog\fR(1) to reset your branch back to where it was before\&. If the diff looks inconsequential, you can use \fBgit rebase \-\-skip\fR to ignore it, and then \fBgit rebase\-update\fR will clean it up for you\&.
  405. .sp
  406. Once you\(cqre done resolving all of the merge conflict, just run \fBgit rebase\-update\fR, and it will pick up where it left off\&. Once the command has finished updating all of your branches, it will return you back to the branch you started on\&.
  407. .if n \{\
  408. .sp
  409. .\}
  410. .RS 4
  411. .it 1 an-trap
  412. .nr an-no-space-flag 1
  413. .nr an-break-flag 1
  414. .br
  415. .ps +1
  416. \fBNote\fR
  417. .ps -1
  418. .br
  419. .sp
  420. Running \fBgit rebase\-update\fR will update all your branches, but it will not automatically run \fBgclient sync\fR to update your dependencies\&. Use caution when running \fBgit reset\fR on branches managed by \fIdepot_tools\fR\&. These tools track the set of "commits contained in the branch" from a branch\(cqs "merge point" to the current branch value\&. See \fBgit help mark\-merge\-base\fR for more discussion of the merge base\&.
  421. .sp .5v
  422. .RE
  423. .SH "MANAGING MULTIPLE CLS"
  424. .sp
  425. Sometimes you want to work on more than one CL at once (say, you have a CL posted for review and want to work on something else)\&. For each CL that you want to work on, just use \fBgit new\-branch <branch_name>\fR\&.
  426. .sp
  427. Once you start to have more than one CL at a time, it can be easy to lose your bearings\&. Fortunately, \fIdepot_tools\fR has two tools to help you out:
  428. .sp
  429. .if n \{\
  430. .RS 4
  431. .\}
  432. .nf
  433. \fB$ git map\fR
  434. *\:\fB 7dcfe47 \fR (\:\fBfrozen_changes\fR\:) 2014\-03\-12 ~ FREEZE\&.unindexed
  435. * \fB4b0c180\fR 2014\-03\-12 ~ modfile
  436. * \fB59a7cca\fR 2014\-03\-12 ~ a deleted file
  437. * \fB6bec695\fR (\:origin/main\:) 2014\-03\-11 ~ Add neat feature \fB<(frozen_changes)\fR
  438. * \fBd15a38a\fR 2014\-03\-11 ~ Epic README update
  439. * \fBd559894\fR (\:\fBmain\fR\:) 2014\-03\-11 ~ Important upstream change
  440. | * \fB9c311fd\fR (\:\fBcool_feature\fR\:) 2014\-03\-11 ~ Respond to CL comments
  441. | | * \fB2a1eeb2\fR (\:\fBsubfeature\fR\:) 2014\-03\-11 ~ integrate with CoolService
  442. | | * \fBd777af6\fR 2014\-03\-11 ~ slick commenting action
  443. | |/
  444. | * \fB265803a\fR 2014\-03\-11 ~ another improvement \fB<(subfeature)\fR
  445. | * \fB6d831ac\fR (\:\fBspleen_tag\fR\:) 2014\-03\-11 ~ Refactor spleen
  446. | * \fB82e74ab\fR 2014\-03\-11 ~ Add widget
  447. |/
  448. * \fBd08c5b3\fR (\:\fBbogus_noparent\fR\:) 2014\-03\-11 ~ Wonderful beginnings \fB<(cool_feature)\fR
  449. .fi
  450. .if n \{\
  451. .RE
  452. .\}
  453. .sp
  454. .sp
  455. Note that this example repo is in dire need of a \fBgit-rebase-update\fR(1)!
  456. .sp
  457. .if n \{\
  458. .RS 4
  459. .\}
  460. .nf
  461. \fB$ git map\-branches\fR
  462. origin/main
  463. cool_feature
  464. subfeature
  465. frozen_changes *
  466. main
  467. .fi
  468. .if n \{\
  469. .RE
  470. .\}
  471. .sp
  472. .PP
  473. \fBgit-map\fR(1)
  474. .RS 4
  475. This tool shows you the history of all of your branches in a pseudo\-graphical format\&. 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 for the full details\&.
  476. .RE
  477. .PP
  478. \fBgit-map-branches\fR(1)
  479. .RS 4
  480. This tool just shows you which branches you have in your repo, and their upstream relationship to each other (as well as which branch you have checked out at the moment)\&.
  481. .RE
  482. .sp
  483. Additionally, sometimes you need to switch between branches, but you\(cqve got work in progress\&. You could use \fBgit-stash\fR(1), but that can be tricky to manage 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:
  484. .sp
  485. \fBgit-freeze\fR(1) allows you to put the current branch in \*(Aqsuspended animation\*(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\&.
  486. .sp
  487. Another useful tool is \fBgit-rename-branch\fR(1)\&. Unlike \fBgit branch \-m <old> <new>\fR, this tool will correctly preserve the upstream relationships of your branch compared to its downstreams\&.
  488. .sp
  489. Finally, take a look at \fBgit-upstream-diff\fR(1)\&. This will show you the combined diff for all the commits on your branch against the upstream tracking branch\&. This is \fIexactly\fR what \fBgit cl upload\fR will push up to code review\&. Additionally, consider trying the \fB\-\-wordwise\fR argument to get a colorized per\-word diff (instead of a per\-line diff)\&.
  490. .SH "MANAGING DEPENDENT CLS"
  491. .sp
  492. Now that you know how to manage \fIindependent\fR CLs, we\(cqll see how to manage \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 reviews)\&.
  493. .sp
  494. Like all of the other CLs we\(cqve created, we use \fBgit-new-branch\fR(1), but this time with an extra argument\&. First, \fBgit checkout\fR the branch you want to base the new one on (i\&.e\&. CL 1), and then run:
  495. .sp
  496. .if n \{\
  497. .RS 4
  498. .\}
  499. .nf
  500. \fB$ git new\-branch \-\-upstream_current <branch_name>\fR
  501. .fi
  502. .if n \{\
  503. .RE
  504. .\}
  505. .sp
  506. .sp
  507. This will make a new branch which tracks the \fIcurrent\fR branch as its upstream (as opposed to \fIorigin/main\fR)\&. All changes you commit to this branch will be in addition to the previous branch, but when you \fBgit cl upload\fR, you will only upload the diff for the dependent (child) branch\&. You may have as many branches nested in this fashion as you like\&.
  508. .sp
  509. \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-upstream\fR(1) and \fBgit-nav-downstream\fR(1)\&.
  510. .sp
  511. Sometimes when dealing with dependent CLs, it turns out that you accidentally based a branch on the wrong upstream, but since then you\(cqve committed changes to 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 dependent 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 that this can also be used to move a branch from tracking \fBorigin/main\fR to \fBlkgr\fR or vice versa\&.
  512. .SH "EXAMPLE WALKTHROUGH"
  513. .sp
  514. This section will demo what a typical workflow looks like when writing, updating, and committing multiple CLs\&.
  515. .sp
  516. .sp
  517. .if n \{\
  518. .RS 4
  519. .\}
  520. .nf
  521. \fB$ fetch chromium\fR
  522. \&.\&.\&. truncated output \&.\&.\&.
  523. \fB$ cd src\fR
  524. .fi
  525. .if n \{\
  526. .RE
  527. .\}
  528. .sp
  529. (only on linux)
  530. .sp
  531. .if n \{\
  532. .RS 4
  533. .\}
  534. .nf
  535. \fB$ \&./build/install\-build\-deps\&.sh\fR
  536. \&.\&.\&. truncated output \&.\&.\&.
  537. .fi
  538. .if n \{\
  539. .RE
  540. .\}
  541. .sp
  542. Pull in all dependencies for HEAD
  543. .sp
  544. .if n \{\
  545. .RS 4
  546. .\}
  547. .nf
  548. \fB$ gclient sync\fR
  549. \&.\&.\&. truncated output \&.\&.\&.
  550. .fi
  551. .if n \{\
  552. .RE
  553. .\}
  554. .sp
  555. Let\*(Aqs fix something!
  556. .sp
  557. .if n \{\
  558. .RS 4
  559. .\}
  560. .nf
  561. \fB$ git new\-branch fix_typo\fR
  562. \fB$ echo \-e \*(Aq/Banana\ens/Banana/Kuun\enwq\*(Aq | ed build/whitespace_file\&.txt\fR
  563. 1503
  564. It was a Domo\-Banana\&.
  565. It was a Domo\-Kuun\&.
  566. 1501
  567. \fB$ git commit \-am \*(AqFix terrible typo\&.\*(Aq\fR
  568. [fix_typo 615ffa7] Fix terrible typo\&.
  569. 1 file changed, 1 insertion(+), 1 deletion(\-)
  570. \fB$ git map\fR
  571. * \fB615ffa720f\fR \fB(HEAD \-> fix_typo\fR\fB) \fR2014\-04\-10 ~ Fix terrible typo\&.
  572. * \fBbeec6f4746\fR \fB(origin/main\fR\fB, origin/HEAD\fR\fB) \fR2014\-04\-10 ~ Make ReflectorImpl use mailboxes
  573. * \fB41290e02b7\fR 2014\-04\-10 ~ don\*(Aqt use glibc\-specific execinfo\&.h on uclibc builds
  574. * \fBa76fde7b7b\fR 2014\-04\-10 ~ [fsp] Add requestUnmount() method together with the request manager\&.
  575. * \fB9de7a713b3\fR 2014\-04\-10 ~ linux_aura: Use system configuration for middle clicking the titlebar\&.
  576. * \fB073b0c203a\fR 2014\-04\-10 ~ ContentView\->ContentViewCore in ContentViewRenderView
  577. * \fB2250f532d7\fR 2014\-04\-10 ~ ozone: evdev: Filter devices by path
  578. * \fB33a7a742b7\fR 2014\-04\-10 ~ Always output seccomp error messages to stderr
  579. \fB$ git status\fR
  580. On branch fix_typo
  581. Your branch is ahead of \*(Aqorigin/main\*(Aq by 1 commit\&.
  582. (use "git push" to publish your local commits)
  583. nothing to commit, working tree clean
  584. \fB$ git cl upload \-r domo@chromium\&.org \-\-send\-mail\fR
  585. \&.\&.\&. truncated output \&.\&.\&.
  586. .fi
  587. .if n \{\
  588. .RE
  589. .\}
  590. .sp
  591. While we wait for feedback, let\*(Aqs do something else\&.
  592. .sp
  593. .if n \{\
  594. .RS 4
  595. .\}
  596. .nf
  597. \fB$ git new\-branch chap2\fR
  598. \fB$ git map\-branches\fR
  599. \fBorigin/main
  600. chap2 *
  601. \fR fix_typo
  602. \fB$ cat >> build/whitespace_file\&.txt <<EOF\fR
  603. "You recall what happened on Mulholland drive?" The ceiling fan rotated slowly
  604. overhead, barely disturbing the thick cigarette smoke\&. No doubt was left about
  605. when the fan was last cleaned\&.
  606. EOF
  607. \fB$ git status\fR
  608. On branch chap2
  609. Your branch is up to date with \*(Aqorigin/main\*(Aq\&.
  610. Changes not staged for commit:
  611. (use "git add <file>\&.\&.\&." to update what will be committed)
  612. (use "git restore <file>\&.\&.\&." to discard changes in working directory)
  613. modified: build/whitespace_file\&.txt
  614. no changes added to commit (use "git add" and/or "git commit \-a")
  615. .fi
  616. .if n \{\
  617. .RE
  618. .\}
  619. .sp
  620. Someone on the code review pointed out that our typo\-fix has a typo :( We\*(Aqre still working on \*(Aqchap2\*(Aq but we really want to land \*(Aqfix_typo\*(Aq, so let\*(Aqs switch over and fix it\&.
  621. .sp
  622. .if n \{\
  623. .RS 4
  624. .\}
  625. .nf
  626. \fB$ git freeze\fR
  627. \fB$ git checkout fix_typo\fR
  628. Switched to branch \*(Aqfix_typo\*(Aq
  629. Your branch is ahead of \*(Aqorigin/main\*(Aq by 1 commit\&.
  630. (use "git push" to publish your local commits)
  631. \fB$ echo \-e \*(Aq/Kuun\ens/Kuun/Kun\enwq\*(Aq | ed build/whitespace_file\&.txt\fR
  632. 1501
  633. It was a Domo\-Kuun\&.
  634. It was a Domo\-Kun\&.
  635. 1500
  636. \fB$ git upstream\-diff \-\-wordwise\fR
  637. \fBdiff \-\-git a/build/whitespace_file\&.txt b/build/whitespace_file\&.txt
  638. index 3eba355\&.\&.57cdcee 100644
  639. \-\-\- a/build/whitespace_file\&.txt
  640. +++ b/build/whitespace_file\&.txt
  641. @@ \-17,7 +17,7 @@ swept up the streets (for it is in London that our scene lies), rattling along
  642. the housetops, and fiercely agitating the scanty flame of the lamps that
  643. struggled against the elements\&. A hooded figure emerged\&.
  644. It was a Domo\-BananaKun\&.
  645. "What took you so long?", inquired his wife\&.
  646. \fR
  647. \fB$ git commit \-am \*(AqFix typo for good!\*(Aq\fR
  648. [fix_typo 2c0ad9c] Fix typo for good!
  649. 1 file changed, 1 insertion(+), 1 deletion(\-)
  650. \fB$ git cl upload\fR
  651. \&.\&.\&. truncated output \&.\&.\&.
  652. .fi
  653. .if n \{\
  654. .RE
  655. .\}
  656. .sp
  657. Since we got lgtm, let the CQ land it\&.
  658. .sp
  659. .if n \{\
  660. .RS 4
  661. .\}
  662. .nf
  663. \fB$ git cl set_commit\fR
  664. \fB$ git map\fR
  665. * \fB0e2e52e72e\fR \fB(chap2\fR\fB) \fR2014\-04\-10 ~ FREEZE\&.unindexed
  666. | * \fB2c0ad9c59b\fR \fB(HEAD \-> fix_typo\fR\fB) \fR2014\-04\-10 ~ Fix typo for good!
  667. | * \fB615ffa720f\fR 2014\-04\-10 ~ Fix terrible typo\&.
  668. |/
  669. * \fBbeec6f4746\fR \fB(origin/main\fR\fB, origin/HEAD\fR\fB) \fR2014\-04\-10 ~ Make ReflectorImpl use mailboxes <(\fBchap2\fR)
  670. * \fB41290e02b7\fR 2014\-04\-10 ~ don\*(Aqt use glibc\-specific execinfo\&.h on uclibc builds
  671. * \fBa76fde7b7b\fR 2014\-04\-10 ~ [fsp] Add requestUnmount() method together with the request manager\&.
  672. * \fB9de7a713b3\fR 2014\-04\-10 ~ linux_aura: Use system configuration for middle clicking the titlebar\&.
  673. * \fB073b0c203a\fR 2014\-04\-10 ~ ContentView\->ContentViewCore in ContentViewRenderView
  674. * \fB2250f532d7\fR 2014\-04\-10 ~ ozone: evdev: Filter devices by path
  675. * \fB33a7a742b7\fR 2014\-04\-10 ~ Always output seccomp error messages to stderr
  676. .fi
  677. .if n \{\
  678. .RE
  679. .\}
  680. .sp
  681. Switch back to where we were using the nav* commands (for fun\&.\&.\&. git checkout would work here too)
  682. .sp
  683. .if n \{\
  684. .RS 4
  685. .\}
  686. .nf
  687. \fB$ git map\-branches\fR
  688. origin/main
  689. chap2
  690. \fB fix_typo *
  691. \fR
  692. \fB$ git nav\-upstream\fR
  693. Note: switching to \*(Aqorigin/main\*(Aq\&.
  694. You are in \*(Aqdetached HEAD\*(Aq state\&. You can look around, make experimental
  695. changes and commit them, and you can discard any commits you make in this
  696. state without impacting any branches by switching back to a branch\&.
  697. If you want to create a new branch to retain commits you create, you may
  698. do so (now or later) by using \-c with the switch command\&. Example:
  699. git switch \-c <new\-branch\-name>
  700. Or undo this operation with:
  701. git switch \-
  702. Turn off this advice by setting config variable advice\&.detachedHead to false
  703. HEAD is now at beec6f4 Make ReflectorImpl use mailboxes
  704. \fB$ git nav\-downstream\fR
  705. Previous HEAD position was beec6f4 Make ReflectorImpl use mailboxes
  706. Switched to branch \*(Aqchap2\*(Aq
  707. Your branch is ahead of \*(Aqorigin/main\*(Aq by 1 commit\&.
  708. (use "git push" to publish your local commits)
  709. Please select a downstream branch
  710. 0\&. chap2
  711. 1\&. fix_typo
  712. Selection (0\-1)[0]: 0
  713. \fB$ git map\-branches\fR
  714. origin/main
  715. \fB chap2 *
  716. \fR fix_typo
  717. .fi
  718. .if n \{\
  719. .RE
  720. .\}
  721. .sp
  722. Now we can pick up on chapter2 where we left off\&.
  723. .sp
  724. .if n \{\
  725. .RS 4
  726. .\}
  727. .nf
  728. \fB$ git thaw\fR
  729. \fB$ git diff\fR
  730. \fBdiff \-\-git a/build/whitespace_file\&.txt b/build/whitespace_file\&.txt
  731. index 3eba355\&.\&.9d08d9d 100644
  732. \-\-\- a/build/whitespace_file\&.txt
  733. +++ b/build/whitespace_file\&.txt
  734. @@ \-34,3 +34,7 @@ with his fork, watching the runny jelly spread and pool across his plate,
  735. like the blood of a dying fawn\&. \e"It reminds me of that time \-\-\e" he started, as
  736. his wife cut in quickly: \e"\-\- please\&. I can\*(Aqt bear to hear it\&.\e"\&. A flury of
  737. images coming from the past flowed through his mind\&.
  738. +
  739. +"You recall what happened on Mulholland drive?" The ceiling fan rotated slowly
  740. +overhead, barely disturbing the thick cigarette smoke\&. No doubt was left about
  741. +when the fan was last cleaned\&.
  742. \fR
  743. \fB$ cat >> build/whitespace_file\&.txt <<EOF\fR
  744. There was an poignant pause\&.
  745. EOF
  746. \fB$ git diff\fR
  747. \fBdiff \-\-git a/build/whitespace_file\&.txt b/build/whitespace_file\&.txt
  748. index 3eba355\&.\&.e3a55de 100644
  749. \-\-\- a/build/whitespace_file\&.txt
  750. +++ b/build/whitespace_file\&.txt
  751. @@ \-34,3 +34,9 @@ with his fork, watching the runny jelly spread and pool across his plate,
  752. like the blood of a dying fawn\&. \e"It reminds me of that time \-\-\e" he started, as
  753. his wife cut in quickly: \e"\-\- please\&. I can\*(Aqt bear to hear it\&.\e"\&. A flury of
  754. images coming from the past flowed through his mind\&.
  755. +
  756. +"You recall what happened on Mulholland drive?" The ceiling fan rotated slowly
  757. +overhead, barely disturbing the thick cigarette smoke\&. No doubt was left about
  758. +when the fan was last cleaned\&.
  759. +
  760. +There was an poignant pause\&.
  761. \fR
  762. \fB$ git commit \-am \*(AqFinish chapter 2\*(Aq\fR
  763. [chap2 ceef712] Finish chapter 2
  764. 1 file changed, 6 insertions(+)
  765. \fB$ git map\fR
  766. * \fBceef712d7f\fR \fB(HEAD \-> chap2\fR\fB) \fR2014\-04\-10 ~ Finish chapter 2
  767. | * \fB2c0ad9c59b\fR \fB(fix_typo\fR\fB) \fR2014\-04\-10 ~ Fix typo for good!
  768. | * \fB615ffa720f\fR 2014\-04\-10 ~ Fix terrible typo\&.
  769. |/
  770. * \fBbeec6f4746\fR \fB(origin/main\fR\fB, origin/HEAD\fR\fB) \fR2014\-04\-10 ~ Make ReflectorImpl use mailboxes <(\fBfix_typo\fR)
  771. * \fB41290e02b7\fR 2014\-04\-10 ~ don\*(Aqt use glibc\-specific execinfo\&.h on uclibc builds
  772. * \fBa76fde7b7b\fR 2014\-04\-10 ~ [fsp] Add requestUnmount() method together with the request manager\&.
  773. * \fB9de7a713b3\fR 2014\-04\-10 ~ linux_aura: Use system configuration for middle clicking the titlebar\&.
  774. * \fB073b0c203a\fR 2014\-04\-10 ~ ContentView\->ContentViewCore in ContentViewRenderView
  775. * \fB2250f532d7\fR 2014\-04\-10 ~ ozone: evdev: Filter devices by path
  776. * \fB33a7a742b7\fR 2014\-04\-10 ~ Always output seccomp error messages to stderr
  777. \fB$ git cl upload \-r domo@chromium\&.org \-\-send\-mail\fR
  778. \&.\&.\&. truncated output \&.\&.\&.
  779. .fi
  780. .if n \{\
  781. .RE
  782. .\}
  783. .sp
  784. We poke a committer until they lgtm :)
  785. .sp
  786. .if n \{\
  787. .RS 4
  788. .\}
  789. .nf
  790. \fB$ git cl set_commit\fR
  791. .fi
  792. .if n \{\
  793. .RE
  794. .\}
  795. .sp
  796. While that runs through the CQ, let\*(Aqs get started on chapter 3\&. Since we know that chapter 3 depends on chapter 2, we\*(Aqll track the current chapter2 branch\&.
  797. .sp
  798. .if n \{\
  799. .RS 4
  800. .\}
  801. .nf
  802. \fB$ git new\-branch \-\-upstream_current chap3\fR
  803. \fB$ cat >> build/whitespace_file\&.txt <<EOF\fR
  804. CHAPTER 3:
  805. Mr\&. Usagi felt that something wasn\*(Aqt right\&. Shortly after the Domo\-Kun left he
  806. began feeling sick\&.
  807. EOF
  808. \fB$ git commit \-am \*(Aqbeginning of chapter 3\*(Aq\fR
  809. [chap3 7d4238a] beginning of chapter 3
  810. 1 file changed, 4 insertions(+)
  811. \fB$ git map\fR
  812. * \fB7d4238a1e2\fR \fB(HEAD \-> chap3\fR\fB) \fR2014\-04\-10 ~ beginning of chapter 3
  813. * \fBceef712d7f\fR \fB(chap2\fR\fB) \fR2014\-04\-10 ~ Finish chapter 2
  814. | * \fB2c0ad9c59b\fR \fB(fix_typo\fR\fB) \fR2014\-04\-10 ~ Fix typo for good!
  815. | * \fB615ffa720f\fR 2014\-04\-10 ~ Fix terrible typo\&.
  816. |/
  817. * \fBbeec6f4746\fR \fB(origin/main\fR\fB, origin/HEAD\fR\fB) \fR2014\-04\-10 ~ Make ReflectorImpl use mailboxes <(\fBchap2, fix_typo\fR)
  818. * \fB41290e02b7\fR 2014\-04\-10 ~ don\*(Aqt use glibc\-specific execinfo\&.h on uclibc builds
  819. * \fBa76fde7b7b\fR 2014\-04\-10 ~ [fsp] Add requestUnmount() method together with the request manager\&.
  820. * \fB9de7a713b3\fR 2014\-04\-10 ~ linux_aura: Use system configuration for middle clicking the titlebar\&.
  821. * \fB073b0c203a\fR 2014\-04\-10 ~ ContentView\->ContentViewCore in ContentViewRenderView
  822. * \fB2250f532d7\fR 2014\-04\-10 ~ ozone: evdev: Filter devices by path
  823. * \fB33a7a742b7\fR 2014\-04\-10 ~ Always output seccomp error messages to stderr
  824. .fi
  825. .if n \{\
  826. .RE
  827. .\}
  828. .sp
  829. We haven\*(Aqt updated the code in a while, so let\*(Aqs do that now\&.
  830. .sp
  831. .if n \{\
  832. .RS 4
  833. .\}
  834. .nf
  835. \fB$ git rebase\-update\fR
  836. Fetching origin
  837. From https://upstream
  838. beec6f4\&.\&.59cdb73 main \-> origin/main
  839. Rebasing: chap2
  840. Rebasing: fix_typo
  841. Failed! Attempting to squash fix_typo \&.\&.\&. Success!
  842. Rebasing: chap3
  843. Reparented chap3 to track origin/main (was tracking chap2)
  844. Deleted branch fix_typo (was 5d26fec)\&.
  845. Deleted branch chap2 (was 5d26fec)\&.
  846. Running `git gc \-\-auto` \- Ctrl\-C to abort is OK\&.
  847. .fi
  848. .if n \{\
  849. .RE
  850. .\}
  851. .sp
  852. Well look at that\&. The CQ landed our typo and chapter2 branches already and git rebase\-update cleaned them up for us\&.
  853. .sp
  854. .if n \{\
  855. .RS 4
  856. .\}
  857. .nf
  858. \fB$ gclient sync\fR
  859. \&.\&.\&. truncated output \&.\&.\&.
  860. \fB$ git map\fR
  861. * \fB93fe917ad1\fR \fB(HEAD \-> chap3\fR\fB) \fR2014\-04\-10 ~ beginning of chapter 3
  862. * \fB5d26fec369\fR \fB(origin/main\fR\fB, origin/HEAD\fR\fB) \fR2014\-04\-10 ~ Finish chapter 2
  863. * \fBdf7fefbf06\fR 2014\-04\-10 ~ Revert 255617, due to it not tracking use of the link doctor page properly\&.
  864. * \fB4b39cda0ac\fR 2014\-04\-10 ~ Fix terrible typo\&.
  865. * \fB248c5b6fe3\fR 2014\-04\-10 ~ Temporarily CHECK(trial) in ChromeRenderProcessObserver::OnSetFieldTrialGroup\&.
  866. * \fB8171df8af9\fR 2014\-04\-10 ~ Remove AMD family check for the flapper crypto accelerator\&.
  867. * \fBd6a30d2e56\fR 2014\-04\-10 ~ Change the Pica load benchmark to listen for the polymer\-ready event
  868. * \fBbeec6f4746\fR 2014\-04\-10 ~ Make ReflectorImpl use mailboxes
  869. * \fB41290e02b7\fR 2014\-04\-10 ~ don\*(Aqt use glibc\-specific execinfo\&.h on uclibc builds
  870. * \fBa76fde7b7b\fR 2014\-04\-10 ~ [fsp] Add requestUnmount() method together with the request manager\&.
  871. * \fB9de7a713b3\fR 2014\-04\-10 ~ linux_aura: Use system configuration for middle clicking the titlebar\&.
  872. * \fB073b0c203a\fR 2014\-04\-10 ~ ContentView\->ContentViewCore in ContentViewRenderView
  873. * \fB2250f532d7\fR 2014\-04\-10 ~ ozone: evdev: Filter devices by path
  874. * \fB33a7a742b7\fR 2014\-04\-10 ~ Always output seccomp error messages to stderr
  875. .fi
  876. .if n \{\
  877. .RE
  878. .\}
  879. .sp
  880. Someone on IRC mentions that they actually landed a chapter 3 already! We should pull their changes before continuing\&. Brace for a code conflict!
  881. .sp
  882. .if n \{\
  883. .RS 4
  884. .\}
  885. .nf
  886. \fB$ git rebase\-update\fR
  887. Fetching origin
  888. From https://upstream
  889. 5d26fec\&.\&.59cdb73 main \-> origin/main
  890. Rebasing: chap2
  891. \&.\&.\&. lots of output, it\*(Aqs a conflict alright :(\&.\&.\&.
  892. \fB$ git diff\fR
  893. \fBdiff \-\-cc build/whitespace_file\&.txt
  894. index 1293282,f903ea2\&.\&.0000000
  895. \-\-\- a/build/whitespace_file\&.txt
  896. +++ b/build/whitespace_file\&.txt
  897. @@@ \-42,4 \-42,5 +42,9 @@@ when the fan was last cleaned
  898. There was an poignant pause\&.
  899. CHAPTER 3:
  900. ++<<<<<<< HEAD
  901. +Hilariousness! This chapter is awesome!
  902. ++=======
  903. + Mr\&. Usagi felt that something wasn\*(Aqt right\&. Shortly after the Domo\-Kun left he
  904. + began feeling sick\&.
  905. ++>>>>>>> 93fe917 (beginning of chapter 3)
  906. \fR
  907. .fi
  908. .if n \{\
  909. .RE
  910. .\}
  911. .sp
  912. Oh, well, that\*(Aqs not too bad\&. In fact\&.\&.\&. that\*(Aqs a terrible chapter 3!
  913. .sp
  914. .if n \{\
  915. .RS 4
  916. .\}
  917. .nf
  918. \fB$ $EDITOR build/whitespace_file\&.txt\fR
  919. \&.\&.\&. /me deletes bad chapter 3 \&.\&.\&.
  920. \fB$ git add build/whitespace_file\&.txt\fR
  921. \fB$ git diff \-\-cached\fR
  922. \fBdiff \-\-git a/build/whitespace_file\&.txt b/build/whitespace_file\&.txt
  923. index 1293282\&.\&.f903ea2 100644
  924. \-\-\- a/build/whitespace_file\&.txt
  925. +++ b/build/whitespace_file\&.txt
  926. @@ \-42,4 +42,5 @@ when the fan was last cleaned\&.
  927. There was an poignant pause\&.
  928. CHAPTER 3:
  929. \-Hilariousness! This chapter is awesome!
  930. +Mr\&. Usagi felt that something wasn\*(Aqt right\&. Shortly after the Domo\-Kun left he
  931. +began feeling sick\&.
  932. \fR
  933. .fi
  934. .if n \{\
  935. .RE
  936. .\}
  937. .sp
  938. Much better
  939. .sp
  940. .if n \{\
  941. .RS 4
  942. .\}
  943. .nf
  944. \fB$ git rebase \-\-continue\fR
  945. [detached HEAD 1cb4f5b] beginning of chapter 3
  946. 1 file changed, 2 insertions(+), 1 deletion(\-)
  947. \fB$ git rebase\-update\fR
  948. Fetching origin
  949. chap3 up\-to\-date
  950. Running `git gc \-\-auto` \- Ctrl\-C to abort is OK\&.
  951. \fB$ gclient sync\fR
  952. \&.\&.\&. truncated output \&.\&.\&.
  953. \fB$ git map\fR
  954. * \fB1cb4f5b622\fR \fB(HEAD \-> chap3\fR\fB) \fR2014\-04\-10 ~ beginning of chapter 3
  955. * \fB59cdb7335b\fR \fB(origin/main\fR\fB, origin/HEAD\fR\fB) \fR2014\-04\-10 ~ Refactor data interchange format\&.
  956. * \fB34676a3583\fR 2014\-04\-10 ~ Ensure FS is exited for all not\-in\-same\-page navigations\&.
  957. * \fB7d4784e867\fR 2014\-04\-10 ~ Add best chapter2 ever!
  958. * \fB5d26fec369\fR 2014\-04\-10 ~ Finish chapter 2
  959. * \fBdf7fefbf06\fR 2014\-04\-10 ~ Revert 255617, due to it not tracking use of the link doctor page properly\&.
  960. * \fB4b39cda0ac\fR 2014\-04\-10 ~ Fix terrible typo\&.
  961. * \fB248c5b6fe3\fR 2014\-04\-10 ~ Temporarily CHECK(trial) in ChromeRenderProcessObserver::OnSetFieldTrialGroup\&.
  962. * \fB8171df8af9\fR 2014\-04\-10 ~ Remove AMD family check for the flapper crypto accelerator\&.
  963. * \fBd6a30d2e56\fR 2014\-04\-10 ~ Change the Pica load benchmark to listen for the polymer\-ready event
  964. * \fBbeec6f4746\fR 2014\-04\-10 ~ Make ReflectorImpl use mailboxes
  965. * \fB41290e02b7\fR 2014\-04\-10 ~ don\*(Aqt use glibc\-specific execinfo\&.h on uclibc builds
  966. * \fBa76fde7b7b\fR 2014\-04\-10 ~ [fsp] Add requestUnmount() method together with the request manager\&.
  967. * \fB9de7a713b3\fR 2014\-04\-10 ~ linux_aura: Use system configuration for middle clicking the titlebar\&.
  968. * \fB073b0c203a\fR 2014\-04\-10 ~ ContentView\->ContentViewCore in ContentViewRenderView
  969. * \fB2250f532d7\fR 2014\-04\-10 ~ ozone: evdev: Filter devices by path
  970. * \fB33a7a742b7\fR 2014\-04\-10 ~ Always output seccomp error messages to stderr
  971. \fB$ git cl upload\fR
  972. \&.\&.\&. truncated output \&.\&.\&.
  973. .fi
  974. .if n \{\
  975. .RE
  976. .\}
  977. .sp
  978. .sp
  979. So there you have the basic flow\&. Note that you don\(cqt \fIhave\fR to do chromium development using these tools\&. Any git workflow is compatible, as long as \fBgit cl upload\fR is able to upload good patches\&.
  980. .SH "CONCLUSION"
  981. .sp
  982. 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 tutorial or the man pages for the tools (see the index of all tools here: \fBdepot_tools\fR(7)), please feel free to ask\&.
  983. .SH "GLOSSARY"
  984. .PP
  985. CL
  986. .RS 4
  987. A
  988. \fIchange\-list\fR\&. This is a diff which you would like to commit to the codebase\&.
  989. .RE
  990. .PP
  991. DEPS
  992. .RS 4
  993. A file in the chromium checkout which
  994. \fBgclient sync\fR
  995. uses to determine what dependencies to pull in\&. This file also contains
  996. \fIhooks\fR\&.
  997. .RE
  998. .PP
  999. LKGR
  1000. .RS 4
  1001. Last Known Good Revision\&. This is a
  1002. \fBgit-tag\fR(1)
  1003. which tracks the last version of
  1004. \fBorigin/main\fR
  1005. which has passed the full set of testing on the
  1006. \m[blue]\fBmain Chromium waterfall\fR\m[]\&\s-2\u[6]\d\s+2\&.
  1007. .RE
  1008. .SH "CHROMIUM DEPOT_TOOLS"
  1009. .sp
  1010. Part of the chromium \fBdepot_tools\fR(7) suite\&. These tools are meant to assist with the development of chromium and related projects\&. Download the tools by checking out the \m[blue]\fBgit repository\fR\m[]\&\s-2\u[7]\d\s+2\&.
  1011. .SH "NOTES"
  1012. .IP " 1." 4
  1013. Think like (a) Git
  1014. .RS 4
  1015. \%http://think-like-a-git.net/
  1016. .RE
  1017. .IP " 2." 4
  1018. Git Immersion Tutorial
  1019. .RS 4
  1020. \%http://gitimmersion.com/
  1021. .RE
  1022. .IP " 3." 4
  1023. pcottle\(cqs Visual Git Branching
  1024. .RS 4
  1025. \%http://pcottle.github.io/learnGitBranching
  1026. .RE
  1027. .IP " 4." 4
  1028. Pro Git book
  1029. .RS 4
  1030. \%http://git-scm.com/book
  1031. .RE
  1032. .IP " 5." 4
  1033. Chromium code review site
  1034. .RS 4
  1035. \%https://chromium-review.googlesource.com
  1036. .RE
  1037. .IP " 6." 4
  1038. main Chromium waterfall
  1039. .RS 4
  1040. \%http://build.chromium.org
  1041. .RE
  1042. .IP " 7." 4
  1043. git repository
  1044. .RS 4
  1045. \%https://chromium.googlesource.com/chromium/tools/depot_tools.git
  1046. .RE