blob: dec26e8f722f6cea42101058e094485269b52a67 [file] [log] [blame]
Eric Parkc9931992019-07-29 13:10:53 +09001
2
3
4
5<!doctype html>
6<html lang="en" class="no-js">
7 <head>
8
9 <meta charset="utf-8">
10 <meta name="viewport" content="width=device-width,initial-scale=1">
11 <meta http-equiv="x-ua-compatible" content="ie=edge">
12
13
14
15
16 <meta name="lang:clipboard.copy" content="Copy to clipboard">
17
18 <meta name="lang:clipboard.copied" content="Copied to clipboard">
19
20 <meta name="lang:search.language" content="en">
21
22 <meta name="lang:search.pipeline.stopwords" content="True">
23
24 <meta name="lang:search.pipeline.trimmer" content="True">
25
26 <meta name="lang:search.result.none" content="No matching documents">
27
28 <meta name="lang:search.result.one" content="1 matching document">
29
30 <meta name="lang:search.result.other" content="# matching documents">
31
32 <meta name="lang:search.tokenizer" content="[\s\-]+">
33
34 <link rel="shortcut icon" href="../../assets/images/favicon.png">
35 <meta name="generator" content="mkdocs-1.0.4, mkdocs-material-4.4.0">
36
37
38
39 <title>Git Started - Team Bliss</title>
40
41
42
43 <link rel="stylesheet" href="../../assets/stylesheets/application.0284f74d.css">
44
45
46
47
48 <script src="../../assets/javascripts/modernizr.74668098.js"></script>
49
50
51
52 <link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
53 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700|Roboto+Mono&display=fallback">
54 <style>body,input{font-family:"Roboto","Helvetica Neue",Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono","Courier New",Courier,monospace}</style>
55
56
57 <link rel="stylesheet" href="../../assets/fonts/material-icons.css">
58
59
60
61
62
63
64 </head>
65
66 <body dir="ltr">
67
68 <svg class="md-svg">
69 <defs>
70
71
72 </defs>
73 </svg>
74 <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
75 <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
76 <label class="md-overlay" data-md-component="overlay" for="__drawer"></label>
77
78 <a href="#git-started" tabindex="1" class="md-skip">
79 Skip to content
80 </a>
81
82
83 <header class="md-header" data-md-component="header">
84 <nav class="md-header-nav md-grid">
85 <div class="md-flex">
86 <div class="md-flex__cell md-flex__cell--shrink">
87 <a href="../.." title="Team Bliss" class="md-header-nav__button md-logo">
88
89 <i class="md-icon"></i>
90
91 </a>
92 </div>
93 <div class="md-flex__cell md-flex__cell--shrink">
94 <label class="md-icon md-icon--menu md-header-nav__button" for="__drawer"></label>
95 </div>
96 <div class="md-flex__cell md-flex__cell--stretch">
97 <div class="md-flex__ellipsis md-header-nav__title" data-md-component="title">
98
99 <span class="md-header-nav__topic">
100 Team Bliss
101 </span>
102 <span class="md-header-nav__topic">
103
104 Git Started
105
106 </span>
107
108 </div>
109 </div>
110 <div class="md-flex__cell md-flex__cell--shrink">
111
112 <label class="md-icon md-icon--search md-header-nav__button" for="__search"></label>
113
114<div class="md-search" data-md-component="search" role="dialog">
115 <label class="md-search__overlay" for="__search"></label>
116 <div class="md-search__inner" role="search">
117 <form class="md-search__form" name="search">
118 <input type="text" class="md-search__input" name="query" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="query" data-md-state="active">
119 <label class="md-icon md-search__icon" for="__search"></label>
120 <button type="reset" class="md-icon md-search__icon" data-md-component="reset" tabindex="-1">
121 &#xE5CD;
122 </button>
123 </form>
124 <div class="md-search__output">
125 <div class="md-search__scrollwrap" data-md-scrollfix>
126 <div class="md-search-result" data-md-component="result">
127 <div class="md-search-result__meta">
128 Type to start searching
129 </div>
130 <ol class="md-search-result__list"></ol>
131 </div>
132 </div>
133 </div>
134 </div>
135</div>
136
137 </div>
138
139 </div>
140 </nav>
141</header>
142
143 <div class="md-container">
144
145
146
147
148 <main class="md-main">
149 <div class="md-main__inner md-grid" data-md-component="container">
150
151
152 <div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
153 <div class="md-sidebar__scrollwrap">
154 <div class="md-sidebar__inner">
155 <nav class="md-nav md-nav--primary" data-md-level="0">
156 <label class="md-nav__title md-nav__title--site" for="__drawer">
157 <a href="../.." title="Team Bliss" class="md-nav__button md-logo">
158
159 <i class="md-icon"></i>
160
161 </a>
162 Team Bliss
163 </label>
164
165 <ul class="md-nav__list" data-md-scrollfix>
166
167
168
169
170
171
172 <li class="md-nav__item">
173 <a href="../.." title="Welcome to the wiki!" class="md-nav__link">
174 Welcome to the wiki!
175 </a>
176 </li>
177
178
179
180
181
182
183
184 <li class="md-nav__item md-nav__item--nested">
185
186 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-2" type="checkbox" id="nav-2">
187
188 <label class="md-nav__link" for="nav-2">
189 Bliss OS
190 </label>
191 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
192 <label class="md-nav__title" for="nav-2">
193 Bliss OS
194 </label>
195 <ul class="md-nav__list" data-md-scrollfix>
196
197
198
199
200
201
202
203 <li class="md-nav__item">
204 <a href="../../Bliss OS/" title="Index" class="md-nav__link">
205 Index
206 </a>
207 </li>
208
209
210 </ul>
211 </nav>
212 </li>
213
214
215
216
217
218
219
220 <li class="md-nav__item md-nav__item--nested">
221
222 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3">
223
224 <label class="md-nav__link" for="nav-3">
225 BlissRoms
226 </label>
227 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
228 <label class="md-nav__title" for="nav-3">
229 BlissRoms
230 </label>
231 <ul class="md-nav__list" data-md-scrollfix>
232
233
234
235
236
237
238
239 <li class="md-nav__item">
240 <a href="../../BlissRoms/" title="Index" class="md-nav__link">
241 Index
242 </a>
243 </li>
244
245
246
247
248
249
250
251 <li class="md-nav__item">
252 <a href="../../BlissRoms/build-guide/" title="BuildGuide" class="md-nav__link">
253 BuildGuide
254 </a>
255 </li>
256
257
258
259
260
261
262
263 <li class="md-nav__item">
264 <a href="../../BlissRoms/build-tips/" title="Build Tips" class="md-nav__link">
265 Build Tips
266 </a>
267 </li>
268
269
270 </ul>
271 </nav>
272 </li>
273
274
275
276
277
278
279
280
281
282 <li class="md-nav__item md-nav__item--active md-nav__item--nested">
283
284 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4" checked>
285
286 <label class="md-nav__link" for="nav-4">
287 Common
288 </label>
289 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
290 <label class="md-nav__title" for="nav-4">
291 Common
292 </label>
293 <ul class="md-nav__list" data-md-scrollfix>
294
295
296
297
298
299
300
301 <li class="md-nav__item">
302 <a href="../" title="Index" class="md-nav__link">
303 Index
304 </a>
305 </li>
306
307
308
309
310
311
312
313
314
315 <li class="md-nav__item md-nav__item--active">
316
317 <input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
318
319
320
321
322 <label class="md-nav__link md-nav__link--active" for="__toc">
323 Git Started
324 </label>
325
326 <a href="./" title="Git Started" class="md-nav__link md-nav__link--active">
327 Git Started
328 </a>
329
330
331<nav class="md-nav md-nav--secondary">
332
333
334
335
336
337 <label class="md-nav__title" for="__toc">Table of contents</label>
338 <ul class="md-nav__list" data-md-scrollfix>
339
340 <li class="md-nav__item">
341 <a href="#foreword" title="Foreword" class="md-nav__link">
342 Foreword
343 </a>
344
345 <nav class="md-nav">
346 <ul class="md-nav__list">
347
348 <li class="md-nav__item">
349 <a href="#installation" title="Installation" class="md-nav__link">
350 Installation
351 </a>
352
353</li>
354
355 <li class="md-nav__item">
356 <a href="#get-the-terminal-set-up" title="Get the terminal set up" class="md-nav__link">
357 Get the terminal set up
358 </a>
359
360</li>
361
362 <li class="md-nav__item">
363 <a href="#register-at-gerrit" title="Register at Gerrit" class="md-nav__link">
364 Register at Gerrit
365 </a>
366
367 <nav class="md-nav">
368 <ul class="md-nav__list">
369
370 <li class="md-nav__item">
371 <a href="#gerrit-shows-an-error-about-the-key" title="Gerrit shows an error about the key!" class="md-nav__link">
372 Gerrit shows an error about the key!
373 </a>
374
375</li>
376
377 </ul>
378 </nav>
379
380</li>
381
382 <li class="md-nav__item">
383 <a href="#reviewing-code" title="Reviewing Code" class="md-nav__link">
384 Reviewing Code
385 </a>
386
387 <nav class="md-nav">
388 <ul class="md-nav__list">
389
390 <li class="md-nav__item">
391 <a href="#my-output-is-blank-or-different-why" title="My output is blank (or different.) Why?" class="md-nav__link">
392 My output is blank (or different.) Why?
393 </a>
394
395</li>
396
397 <li class="md-nav__item">
398 <a href="#cherry-picking-commits-to-current-branch" title="Cherry-picking commits to current branch" class="md-nav__link">
399 Cherry-picking commits to current branch
400 </a>
401
402</li>
403
404 <li class="md-nav__item">
405 <a href="#cherry-picking-commits-to-new-branch" title="Cherry-picking commits to new branch" class="md-nav__link">
406 Cherry-picking commits to new branch
407 </a>
408
409</li>
410
411 </ul>
412 </nav>
413
414</li>
415
416 <li class="md-nav__item">
417 <a href="#submitting-code" title="Submitting code" class="md-nav__link">
418 Submitting code
419 </a>
420
421</li>
422
423 <li class="md-nav__item">
424 <a href="#picking-from-other-sources" title="Picking from other sources" class="md-nav__link">
425 Picking from other sources
426 </a>
427
428</li>
429
430 <li class="md-nav__item">
431 <a href="#conclusion" title="Conclusion" class="md-nav__link">
432 Conclusion
433 </a>
434
435</li>
436
437 </ul>
438 </nav>
439
440</li>
441
442
443
444
445
446 </ul>
447
448</nav>
449
450 </li>
451
452
453 </ul>
454 </nav>
455 </li>
456
457
458
459
460
461
462
463 <li class="md-nav__item md-nav__item--nested">
464
465 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
466
467 <label class="md-nav__link" for="nav-5">
468 Infrastructure
469 </label>
470 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
471 <label class="md-nav__title" for="nav-5">
472 Infrastructure
473 </label>
474 <ul class="md-nav__list" data-md-scrollfix>
475
476
477
478
479
480
481
482 <li class="md-nav__item">
483 <a href="../../infrastructure/" title="Index" class="md-nav__link">
484 Index
485 </a>
486 </li>
487
488
489 </ul>
490 </nav>
491 </li>
492
493
494 </ul>
495</nav>
496 </div>
497 </div>
498 </div>
499
500
501 <div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
502 <div class="md-sidebar__scrollwrap">
503 <div class="md-sidebar__inner">
504
505<nav class="md-nav md-nav--secondary">
506
507
508
509
510
511 <label class="md-nav__title" for="__toc">Table of contents</label>
512 <ul class="md-nav__list" data-md-scrollfix>
513
514 <li class="md-nav__item">
515 <a href="#foreword" title="Foreword" class="md-nav__link">
516 Foreword
517 </a>
518
519 <nav class="md-nav">
520 <ul class="md-nav__list">
521
522 <li class="md-nav__item">
523 <a href="#installation" title="Installation" class="md-nav__link">
524 Installation
525 </a>
526
527</li>
528
529 <li class="md-nav__item">
530 <a href="#get-the-terminal-set-up" title="Get the terminal set up" class="md-nav__link">
531 Get the terminal set up
532 </a>
533
534</li>
535
536 <li class="md-nav__item">
537 <a href="#register-at-gerrit" title="Register at Gerrit" class="md-nav__link">
538 Register at Gerrit
539 </a>
540
541 <nav class="md-nav">
542 <ul class="md-nav__list">
543
544 <li class="md-nav__item">
545 <a href="#gerrit-shows-an-error-about-the-key" title="Gerrit shows an error about the key!" class="md-nav__link">
546 Gerrit shows an error about the key!
547 </a>
548
549</li>
550
551 </ul>
552 </nav>
553
554</li>
555
556 <li class="md-nav__item">
557 <a href="#reviewing-code" title="Reviewing Code" class="md-nav__link">
558 Reviewing Code
559 </a>
560
561 <nav class="md-nav">
562 <ul class="md-nav__list">
563
564 <li class="md-nav__item">
565 <a href="#my-output-is-blank-or-different-why" title="My output is blank (or different.) Why?" class="md-nav__link">
566 My output is blank (or different.) Why?
567 </a>
568
569</li>
570
571 <li class="md-nav__item">
572 <a href="#cherry-picking-commits-to-current-branch" title="Cherry-picking commits to current branch" class="md-nav__link">
573 Cherry-picking commits to current branch
574 </a>
575
576</li>
577
578 <li class="md-nav__item">
579 <a href="#cherry-picking-commits-to-new-branch" title="Cherry-picking commits to new branch" class="md-nav__link">
580 Cherry-picking commits to new branch
581 </a>
582
583</li>
584
585 </ul>
586 </nav>
587
588</li>
589
590 <li class="md-nav__item">
591 <a href="#submitting-code" title="Submitting code" class="md-nav__link">
592 Submitting code
593 </a>
594
595</li>
596
597 <li class="md-nav__item">
598 <a href="#picking-from-other-sources" title="Picking from other sources" class="md-nav__link">
599 Picking from other sources
600 </a>
601
602</li>
603
604 <li class="md-nav__item">
605 <a href="#conclusion" title="Conclusion" class="md-nav__link">
606 Conclusion
607 </a>
608
609</li>
610
611 </ul>
612 </nav>
613
614</li>
615
616
617
618
619
620 </ul>
621
622</nav>
623 </div>
624 </div>
625 </div>
626
627
628 <div class="md-content">
629 <article class="md-content__inner md-typeset">
630
631
632
633 <h1 id="git-started">Git Started</h1>
634<h2 id="foreword">Foreword</h2>
635<p>This guide helps people learn <code>git</code> commands and how to get the features you want into your favorite ROM and make your own builds. This will help new people get started and will be a great refresher for veteran <code>git</code> users and has instructions for Arch Linux users as well. The document will be ever-changing and evolving because even we will be learning new material and will be putting it in here.</p>
636<h3 id="installation">Installation</h3>
637<p>In order to use <code>git review</code> we need it installed on our local machine. For Ubuntu we use the package manager to install it.</p>
638<pre><code>sudo apt-get install git-review
639</code></pre>
640<p>Or for Arch based installs, use:</p>
641<pre><code>sudo pacman -S git-review
642</code></pre>
643<h3 id="get-the-terminal-set-up">Get the terminal set up</h3>
644<p>First, let's make sure our local <code>git</code> and Gerrit have the same email address associated.</p>
645<pre><code>cd
646cat .gitconfig
647</code></pre>
648<p>This command should show something along those lines:</p>
649<pre><code>[user]
650email = you@youremail.com
651name = Your Name
652</code></pre>
653<p>Edit any incorrect details. Your email and name is used to sign off commits, various changes, etc, so it is important that they are the same ones found on Gerrit and GitHub.</p>
654<p>Next we will create a SSH key named “gerrit” to communicate with the Gerrit server.</p>
655<pre><code>ssh-keygen -t rsa -C you@youremail.com -f ~/.ssh/gerrit
656</code></pre>
657<p>Again, note the email address must be the same here, your <code>.gitconfig</code>, and on Gerrit.</p>
658<h3 id="register-at-gerrit">Register at Gerrit</h3>
659<p>Open your favorite browser and go to <a href="http://review.blissroms.com">http://review.blissroms.com</a>. You will see a “Sign In” button on the top right - click that and register with GitHub. Please note that you will need to use the same email address that you registered with GitHub for your terminal interactions with Gerrit.</p>
660<p>Now we need to add our SSH key to Gerrit. Your name will be on the top right of the page. Click your name and you should see “Settings”. Once there click on the link “SSH Public Keys” on the left sidebar. Once it loads, click "Add Key" on the right.</p>
661<p>Let's copy the key from the terminal and paste it into the browser.</p>
662<pre><code>cat ~/.ssh/gerrit.pub
663</code></pre>
664<p>This should show something like:</p>
665<pre><code>ssh-rsa AAAABBBBBBBBBBCCCCCCCCCCCCCCCCCCDjhl8768usdfsdfuhf/BlahBlahBlah/ThIs+1s/A/fAk3+k3Y/Hdhs+PlCesTvQqfaqHTHwdzGhn2lKVt14WYvQEDKVM9JoE9e8xarNWYa0ZspB1MGn2RVJ3xRp0+Q/pA237uBCl62yTbVGtKQBZB6Q+7A54z795U+G2wCb1rAQnI5yn5q/pQ4NhB0BLml/QRmjn/S8PldEge9Hfdh4Ifdk4r9DKSiicf7IK56jklDHKkJDFkjh/3345L10sTyre3JOeZyvr5SJdyqMtmMv+uSGF28fgZ6/OEO/yBY/eYEI/XVRDaRRat8nGHGae0T4dx me@myemail.com
666</code></pre>
667<p>Starting with the line beginning with ssh-rsa and ending with the email, paste that bit into the browser and click “Add”.</p>
668<h4 id="gerrit-shows-an-error-about-the-key">Gerrit shows an error about the key!</h4>
669<p>Are you sure you used the correct key? Do not use the "private" key. The private key should be kept private as it is the key that allows you to authenticate yourself against servers like Gerrit. When you authenticate using your private key, the servers send out requests encrypted with your "public" key that only your "private" key can decrypt. This is the basis behind SSH authentication. So keep your private key safe, and try pasting the public key! Most public keys end with the characters <code>.pub</code>.</p>
670<p>Then, add the new SSH key to your local identity in terminal.</p>
671<pre><code>eval `ssh-agent`
672</code></pre>
673<p>This should print off a bunch of lines. We’re doing this to launch the ssh-agent before adding the key.</p>
674<pre><code>ssh-add ~/.ssh/gerrit
675</code></pre>
676<p>This will result in something along the lines of:</p>
677<pre><code>Identity added: /home/yourusername/.ssh/gerrit (/home/yourusername/.ssh/gerrit)
678</code></pre>
679<p>If you don’t get this, and get this instead:</p>
680<pre><code>Could not open a connection to your authentication agent.
681</code></pre>
682<p>Or this:</p>
683<pre><code>Error connecting to agent: No such file or directory.
684</code></pre>
685<p>This is because in recent versions of Ubuntu, you need to change how you launch <code>ssh-agent</code>. Run the command below, then try adding your SSH key again.</p>
686<pre><code>eval “$(ssh-agent)”
687</code></pre>
688<p>Now we should be ready to use <code>git review</code>.</p>
689<h3 id="reviewing-code">Reviewing Code</h3>
690<p>Just <code>cd</code> to your source code directory and find the package you want to look at from Gerrit. I’ll use <code>frameworks/base</code> as an example.</p>
691<pre><code># cd into source code directory
692cd ~/bliss/p9.0
693
694# Find project to work on
695cd frameworks/base
696</code></pre>
697<p>Let’s setup the remote to Gerrit:</p>
698<pre><code>git review -s
699</code></pre>
700<p>This should create a <code>gerrit</code> remote. If you added a passphrase to your SSH key you will have to enter that.</p>
701<p>However, if this command outputs something like this:</p>
702<pre><code>Could not connect to gerrit.
703Enter your gerrit username:
704</code></pre>
705<p>And after you input your username, it shows something like this:</p>
706<pre><code>Trying again with ssh://username@review.blissroms.com:29418/platform_frameworks_base.git
707&lt;traceback object at 0x7f7f95ea9e18&gt;
708We don't know where your gerrit is. Please manually create a remote named "gerrit" and try again.
709Could not connect to gerrit at ssh://username@review.blissroms.com:29418/platform_frameworks_base.git
710Traceback (most recent call last):
711 File "/usr/bin/git-review", line 10, in &lt;module&gt;
712 sys.exit(main())
713 File "/usr/lib/python2.7/dist-packages/git_review/cmd.py", line 1534, in main
714 sys.exit(e.EXIT_CODE)
715AttributeError: 'GitReviewException' object has no attribute 'EXIT_CODE'
716</code></pre>
717<p>Why does this happen? This is because the <code>ssh-agent</code> process got killed after prolonged use of the system, so you need to restart it.</p>
718<p>As a quick and dirty fix, run this again:</p>
719<pre><code>eval “$(ssh-agent)”
720</code></pre>
721<p>This should fix it. If not, then you need to go back to Chapter 1 and add your existing key. Don’t make a new key, then you’d need to add a new public key to the Bliss Gerrit.</p>
722<p>Now let’s see if there are any changes we can review.</p>
723<pre><code>git review -l
724</code></pre>
725<p>This outputs:</p>
726<pre><code>2433 new-mm6.0 SystemUI: fix double tap power launching custom lockscreen icon
7272432 new-mm6.0 SystemUI: remove extraneous debug log
728Found 2 items for review
729</code></pre>
730<h4 id="my-output-is-blank-or-different-why">My output is blank (or different.) Why?</h4>
731<p>This is because right now, there are no changes to be reviewed in <code>frameworks/base</code> (or there are different commits to be reviewed.) This is completely normal and to be expected, as we merge and submit new commits frequently. The guide will probably be out of sync with current changes by the time you are reading this.</p>
732<p>Now you have a list of commits sorted by change number with a description of what changes were made.</p>
733<p>We have a few choices of how to pick commits.</p>
734<h4 id="cherry-picking-commits-to-current-branch">Cherry-picking commits to current branch</h4>
735<pre><code>git review -x changenumber
736</code></pre>
737<p>will cherry-pick that commit to the current branch you are in. A benefit of this is the next time you <code>repo sync –force-sync</code>, it will discard the commits you picked.</p>
738<h4 id="cherry-picking-commits-to-new-branch">Cherry-picking commits to new branch</h4>
739<pre><code>git review -d changenumber
740</code></pre>
741<p>will cherry-pick to a new branch based on the submitter’s name and change ID. If you choose this route the change will be in its own branch and when you are done you can just delete that branch.</p>
742<pre><code>Switched to a new branch review/yourusername/changenumber
743</code></pre>
744<p>Now you can review the change. Follow these guidelines:</p>
745<ul>
746<li>Did the ROM build with the change incorporated?</li>
747<li>Did the added feature or fix work in the new build?</li>
748<li>Did the new commit break any other aspects of the build?</li>
749</ul>
750<p>After reviewing these guidelines, log into Gerrit via your web browser, and click on the commit you reviewed. Select the ‘Reply’ button on the top and choose your score. +1 if it works as intended, -1 if not. Be sure to leave comments on why you gave your score (such as “commit A does not show in 320 DPI”, etc)</p>
751<p>Once you're done, return to the base directory (<code>croot</code>) to follow along with the next example!</p>
752<h3 id="submitting-code">Submitting code</h3>
753<p>Go to the directory of the package or app you want to make changes to. We will use <code>frameworks/base</code> as an example.</p>
754<pre><code>cd frameworks/base
755</code></pre>
756<p>Setup the remote to Gerrit if you haven’t already:</p>
757<pre><code>git review -s
758</code></pre>
759<p>Next, make sure you are on the correct branch:</p>
760<pre><code>git branch -t p9.0 BlissRoms/p9.0
761</code></pre>
762<p>This makes sure that your local branch follows the remote branch. <code>-t</code> stands for tracking. Now we need to <code>checkout</code>, to switch to that new branch we tracked. You usually do not need to do the above command, but it is a nice check to do if something is going south.</p>
763<pre><code>git checkout p9.0
764</code></pre>
765<p>This should output:</p>
766<pre><code>Changed to new branch p9.0 tracking upstream BlissRoms/p9.0
767</code></pre>
768<p>Now make your changes, cherry-picks, etc. and commit them. If you need a guide to do that, check out <a href="#picking-from-other-sources">Picking from other sources</a>. When you’re done, come back here! Then all you have to do to send it to gerrit is:</p>
769<pre><code>git review
770</code></pre>
771<p>If you are submitting multiple commits it will ask if you really want to, just type “yes” at the prompt.</p>
772<h3 id="picking-from-other-sources">Picking from other sources</h3>
773<p>So you’ve successfully learned how to commit and send it to Bliss Gerrit. But you need to find something to commit. Thankfully, there are lots of examples you can try out. You can check other teams’ Gerrits and cherry-pick from them.</p>
774<p>For this demonstration, I’m going to use LineageOS's Gerrit. Find the commit you want, and note down the commit ID.</p>
775<p>Now, we need to add LOS’s repositories. If you’re pulling over a commit, you must make sure that we track the repository by going to Bliss’s Gerrit and checking in Projects &gt; List. If the repository is not there, it usually means we aren’t tracking it.</p>
776<pre><code>git remote add los https://github.com/LineageOS/……(your repo name)
777git remote fetch los lineage-16.0
778</code></pre>
779<p>We’ve finished adding LOS’s repositories. Now you need to grab the commit ID you copied earlier and paste it on the command underneath.</p>
780<pre><code>git cherry-pick 9ff831
781</code></pre>
782<p>Replace 9ff831 with your own commit ID. If <code>git</code> complains about duplicate revisions, paste the full SHA1 hash instead of the shorthand <code>git</code> uses.</p>
783<p>Before pushing and submitting, we need to check if our commit was successfully committed. Type the bottom command:</p>
784<pre><code>git log --oneline
785</code></pre>
786<p>After you check that your commit is there, you can push <code>q</code> to quit. Then you can follow the instructions from <a href="#submitting-code">Submitting code</a> again.</p>
787<h3 id="conclusion">Conclusion</h3>
788<p>Don’t worry if you don’t get it at once. It’s a fairly long process of submitting and reviewing at Gerrit. Read the guide again and again and you’ll start to remember commands without looking at this. I will continue with this as I learn more things, I hope this has helped someone.</p>
789<p>-- Vaughn (rwaterspf1)</p>
790<p>-- Eric Park (ideaman924)</p>
791<p>-- Jon West (electrikjesus)</p>
792
793
794
795
796
797
798
799
800
801 </article>
802 </div>
803 </div>
804 </main>
805
806
807<footer class="md-footer">
808
809 <div class="md-footer-nav">
810 <nav class="md-footer-nav__inner md-grid">
811
812 <a href="../" title="Index" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
813 <div class="md-flex__cell md-flex__cell--shrink">
814 <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
815 </div>
816 <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
817 <span class="md-flex__ellipsis">
818 <span class="md-footer-nav__direction">
819 Previous
820 </span>
821 Index
822 </span>
823 </div>
824 </a>
825
826
827 <a href="../../infrastructure/" title="Index" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
828 <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
829 <span class="md-flex__ellipsis">
830 <span class="md-footer-nav__direction">
831 Next
832 </span>
833 Index
834 </span>
835 </div>
836 <div class="md-flex__cell md-flex__cell--shrink">
837 <i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
838 </div>
839 </a>
840
841 </nav>
842 </div>
843
844 <div class="md-footer-meta md-typeset">
845 <div class="md-footer-meta__inner md-grid">
846 <div class="md-footer-copyright">
847
848 powered by
849 <a href="https://www.mkdocs.org">MkDocs</a>
850 and
851 <a href="https://squidfunk.github.io/mkdocs-material/">
852 Material for MkDocs</a>
853 </div>
854
855 </div>
856 </div>
857</footer>
858
859 </div>
860
861 <script src="../../assets/javascripts/application.245445c6.js"></script>
862
863 <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>
864
865
866 </body>
867</html>