blob: 90e2fb59449fddc7fdf4e7c27c761af65f342e2f [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">
Eric Park5e3a1012019-08-12 13:17:03 +0800173 <a href="../.." title="Home" class="md-nav__link">
174 Home
Eric Parkc9931992019-07-29 13:10:53 +0900175 </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
Eric Park608ce5a2019-08-07 21:27:46 +0800210
211
212
213
214
215 <li class="md-nav__item">
Eric Park5e3a1012019-08-12 13:17:03 +0800216 <a href="../../Bliss OS/build-guide/" title="Build Guide" class="md-nav__link">
217 Build Guide
218 </a>
219 </li>
220
221
222
223
224
225
226
227 <li class="md-nav__item">
Eric Park608ce5a2019-08-07 21:27:46 +0800228 <a href="../../Bliss OS/extras/" title="Extras" class="md-nav__link">
229 Extras
230 </a>
231 </li>
232
233
234
235
236
237
238
239 <li class="md-nav__item">
240 <a href="../../Bliss OS/installation-guide/" title="Installation Guide" class="md-nav__link">
241 Installation Guide
242 </a>
243 </li>
244
245
246
247
248
249
250
251 <li class="md-nav__item">
252 <a href="../../Bliss OS/troubleshooting/" title="Troubleshooting" class="md-nav__link">
253 Troubleshooting
254 </a>
255 </li>
256
257
Eric Parkc9931992019-07-29 13:10:53 +0900258 </ul>
259 </nav>
260 </li>
261
262
263
264
265
266
267
268 <li class="md-nav__item md-nav__item--nested">
269
270 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3">
271
272 <label class="md-nav__link" for="nav-3">
273 BlissRoms
274 </label>
275 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
276 <label class="md-nav__title" for="nav-3">
277 BlissRoms
278 </label>
279 <ul class="md-nav__list" data-md-scrollfix>
280
281
282
283
284
285
286
287 <li class="md-nav__item">
288 <a href="../../BlissRoms/" title="Index" class="md-nav__link">
289 Index
290 </a>
291 </li>
292
293
294
295
296
297
298
299 <li class="md-nav__item">
Eric Park608ce5a2019-08-07 21:27:46 +0800300 <a href="../../BlissRoms/build-guide/" title="Build Guide" class="md-nav__link">
301 Build Guide
Eric Parkc9931992019-07-29 13:10:53 +0900302 </a>
303 </li>
304
305
306
307
308
309
310
311 <li class="md-nav__item">
312 <a href="../../BlissRoms/build-tips/" title="Build Tips" class="md-nav__link">
313 Build Tips
314 </a>
315 </li>
316
317
318 </ul>
319 </nav>
320 </li>
321
322
323
324
325
326
327
328
329
330 <li class="md-nav__item md-nav__item--active md-nav__item--nested">
331
332 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4" checked>
333
334 <label class="md-nav__link" for="nav-4">
335 Common
336 </label>
337 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
338 <label class="md-nav__title" for="nav-4">
339 Common
340 </label>
341 <ul class="md-nav__list" data-md-scrollfix>
342
343
344
345
346
347
348
349 <li class="md-nav__item">
350 <a href="../" title="Index" class="md-nav__link">
351 Index
352 </a>
353 </li>
354
355
356
357
358
359
360
361
362
363 <li class="md-nav__item md-nav__item--active">
364
365 <input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
366
367
368
369
370 <label class="md-nav__link md-nav__link--active" for="__toc">
371 Git Started
372 </label>
373
374 <a href="./" title="Git Started" class="md-nav__link md-nav__link--active">
375 Git Started
376 </a>
377
378
379<nav class="md-nav md-nav--secondary">
380
381
382
383
384
385 <label class="md-nav__title" for="__toc">Table of contents</label>
386 <ul class="md-nav__list" data-md-scrollfix>
387
388 <li class="md-nav__item">
389 <a href="#foreword" title="Foreword" class="md-nav__link">
390 Foreword
391 </a>
392
393 <nav class="md-nav">
394 <ul class="md-nav__list">
395
396 <li class="md-nav__item">
397 <a href="#installation" title="Installation" class="md-nav__link">
398 Installation
399 </a>
400
401</li>
402
403 <li class="md-nav__item">
404 <a href="#get-the-terminal-set-up" title="Get the terminal set up" class="md-nav__link">
405 Get the terminal set up
406 </a>
407
408</li>
409
410 <li class="md-nav__item">
411 <a href="#register-at-gerrit" title="Register at Gerrit" class="md-nav__link">
412 Register at Gerrit
413 </a>
414
415 <nav class="md-nav">
416 <ul class="md-nav__list">
417
418 <li class="md-nav__item">
419 <a href="#gerrit-shows-an-error-about-the-key" title="Gerrit shows an error about the key!" class="md-nav__link">
420 Gerrit shows an error about the key!
421 </a>
422
423</li>
424
425 </ul>
426 </nav>
427
428</li>
429
430 <li class="md-nav__item">
431 <a href="#reviewing-code" title="Reviewing Code" class="md-nav__link">
432 Reviewing Code
433 </a>
434
435 <nav class="md-nav">
436 <ul class="md-nav__list">
437
438 <li class="md-nav__item">
439 <a href="#my-output-is-blank-or-different-why" title="My output is blank (or different.) Why?" class="md-nav__link">
440 My output is blank (or different.) Why?
441 </a>
442
443</li>
444
445 <li class="md-nav__item">
446 <a href="#cherry-picking-commits-to-current-branch" title="Cherry-picking commits to current branch" class="md-nav__link">
447 Cherry-picking commits to current branch
448 </a>
449
450</li>
451
452 <li class="md-nav__item">
453 <a href="#cherry-picking-commits-to-new-branch" title="Cherry-picking commits to new branch" class="md-nav__link">
454 Cherry-picking commits to new branch
455 </a>
456
457</li>
458
459 </ul>
460 </nav>
461
462</li>
463
464 <li class="md-nav__item">
465 <a href="#submitting-code" title="Submitting code" class="md-nav__link">
466 Submitting code
467 </a>
468
469</li>
470
471 <li class="md-nav__item">
472 <a href="#picking-from-other-sources" title="Picking from other sources" class="md-nav__link">
473 Picking from other sources
474 </a>
475
476</li>
477
478 <li class="md-nav__item">
479 <a href="#conclusion" title="Conclusion" class="md-nav__link">
480 Conclusion
481 </a>
482
483</li>
484
485 </ul>
486 </nav>
487
488</li>
489
490
491
492
493
494 </ul>
495
496</nav>
497
498 </li>
499
500
Eric Park608ce5a2019-08-07 21:27:46 +0800501
502
503
504
505
506 <li class="md-nav__item">
Eric Park8584eda2019-09-02 09:45:55 +0800507 <a href="../maintaining-proper-authorship/" title="Maintaining proper authorship" class="md-nav__link">
508 Maintaining proper authorship
509 </a>
510 </li>
511
512
513
514
515
516
517
518 <li class="md-nav__item">
Eric Park608ce5a2019-08-07 21:27:46 +0800519 <a href="../using-dippy-bird/" title="Using `dippy-bird`" class="md-nav__link">
520 Using `dippy-bird`
521 </a>
522 </li>
523
524
Eric Parkc9931992019-07-29 13:10:53 +0900525 </ul>
526 </nav>
527 </li>
528
529
530
531
532
533
534
535 <li class="md-nav__item md-nav__item--nested">
536
537 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
538
539 <label class="md-nav__link" for="nav-5">
540 Infrastructure
541 </label>
542 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
543 <label class="md-nav__title" for="nav-5">
544 Infrastructure
545 </label>
546 <ul class="md-nav__list" data-md-scrollfix>
547
548
549
550
551
552
553
554 <li class="md-nav__item">
555 <a href="../../infrastructure/" title="Index" class="md-nav__link">
556 Index
557 </a>
558 </li>
559
560
561 </ul>
562 </nav>
563 </li>
564
565
566 </ul>
567</nav>
568 </div>
569 </div>
570 </div>
571
572
573 <div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
574 <div class="md-sidebar__scrollwrap">
575 <div class="md-sidebar__inner">
576
577<nav class="md-nav md-nav--secondary">
578
579
580
581
582
583 <label class="md-nav__title" for="__toc">Table of contents</label>
584 <ul class="md-nav__list" data-md-scrollfix>
585
586 <li class="md-nav__item">
587 <a href="#foreword" title="Foreword" class="md-nav__link">
588 Foreword
589 </a>
590
591 <nav class="md-nav">
592 <ul class="md-nav__list">
593
594 <li class="md-nav__item">
595 <a href="#installation" title="Installation" class="md-nav__link">
596 Installation
597 </a>
598
599</li>
600
601 <li class="md-nav__item">
602 <a href="#get-the-terminal-set-up" title="Get the terminal set up" class="md-nav__link">
603 Get the terminal set up
604 </a>
605
606</li>
607
608 <li class="md-nav__item">
609 <a href="#register-at-gerrit" title="Register at Gerrit" class="md-nav__link">
610 Register at Gerrit
611 </a>
612
613 <nav class="md-nav">
614 <ul class="md-nav__list">
615
616 <li class="md-nav__item">
617 <a href="#gerrit-shows-an-error-about-the-key" title="Gerrit shows an error about the key!" class="md-nav__link">
618 Gerrit shows an error about the key!
619 </a>
620
621</li>
622
623 </ul>
624 </nav>
625
626</li>
627
628 <li class="md-nav__item">
629 <a href="#reviewing-code" title="Reviewing Code" class="md-nav__link">
630 Reviewing Code
631 </a>
632
633 <nav class="md-nav">
634 <ul class="md-nav__list">
635
636 <li class="md-nav__item">
637 <a href="#my-output-is-blank-or-different-why" title="My output is blank (or different.) Why?" class="md-nav__link">
638 My output is blank (or different.) Why?
639 </a>
640
641</li>
642
643 <li class="md-nav__item">
644 <a href="#cherry-picking-commits-to-current-branch" title="Cherry-picking commits to current branch" class="md-nav__link">
645 Cherry-picking commits to current branch
646 </a>
647
648</li>
649
650 <li class="md-nav__item">
651 <a href="#cherry-picking-commits-to-new-branch" title="Cherry-picking commits to new branch" class="md-nav__link">
652 Cherry-picking commits to new branch
653 </a>
654
655</li>
656
657 </ul>
658 </nav>
659
660</li>
661
662 <li class="md-nav__item">
663 <a href="#submitting-code" title="Submitting code" class="md-nav__link">
664 Submitting code
665 </a>
666
667</li>
668
669 <li class="md-nav__item">
670 <a href="#picking-from-other-sources" title="Picking from other sources" class="md-nav__link">
671 Picking from other sources
672 </a>
673
674</li>
675
676 <li class="md-nav__item">
677 <a href="#conclusion" title="Conclusion" class="md-nav__link">
678 Conclusion
679 </a>
680
681</li>
682
683 </ul>
684 </nav>
685
686</li>
687
688
689
690
691
692 </ul>
693
694</nav>
695 </div>
696 </div>
697 </div>
698
699
700 <div class="md-content">
701 <article class="md-content__inner md-typeset">
702
703
704
705 <h1 id="git-started">Git Started</h1>
706<h2 id="foreword">Foreword</h2>
707<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>
708<h3 id="installation">Installation</h3>
709<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>
710<pre><code>sudo apt-get install git-review
711</code></pre>
712<p>Or for Arch based installs, use:</p>
713<pre><code>sudo pacman -S git-review
714</code></pre>
715<h3 id="get-the-terminal-set-up">Get the terminal set up</h3>
716<p>First, let's make sure our local <code>git</code> and Gerrit have the same email address associated.</p>
717<pre><code>cd
718cat .gitconfig
719</code></pre>
720<p>This command should show something along those lines:</p>
721<pre><code>[user]
722email = you@youremail.com
723name = Your Name
724</code></pre>
725<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>
726<p>Next we will create a SSH key named “gerrit” to communicate with the Gerrit server.</p>
727<pre><code>ssh-keygen -t rsa -C you@youremail.com -f ~/.ssh/gerrit
728</code></pre>
729<p>Again, note the email address must be the same here, your <code>.gitconfig</code>, and on Gerrit.</p>
730<h3 id="register-at-gerrit">Register at Gerrit</h3>
731<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>
732<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>
733<p>Let's copy the key from the terminal and paste it into the browser.</p>
734<pre><code>cat ~/.ssh/gerrit.pub
735</code></pre>
736<p>This should show something like:</p>
737<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
738</code></pre>
739<p>Starting with the line beginning with ssh-rsa and ending with the email, paste that bit into the browser and click “Add”.</p>
740<h4 id="gerrit-shows-an-error-about-the-key">Gerrit shows an error about the key!</h4>
741<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>
742<p>Then, add the new SSH key to your local identity in terminal.</p>
743<pre><code>eval `ssh-agent`
744</code></pre>
745<p>This should print off a bunch of lines. We’re doing this to launch the ssh-agent before adding the key.</p>
746<pre><code>ssh-add ~/.ssh/gerrit
747</code></pre>
748<p>This will result in something along the lines of:</p>
749<pre><code>Identity added: /home/yourusername/.ssh/gerrit (/home/yourusername/.ssh/gerrit)
750</code></pre>
751<p>If you don’t get this, and get this instead:</p>
752<pre><code>Could not open a connection to your authentication agent.
753</code></pre>
754<p>Or this:</p>
755<pre><code>Error connecting to agent: No such file or directory.
756</code></pre>
757<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>
758<pre><code>eval “$(ssh-agent)”
759</code></pre>
760<p>Now we should be ready to use <code>git review</code>.</p>
761<h3 id="reviewing-code">Reviewing Code</h3>
762<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>
763<pre><code># cd into source code directory
764cd ~/bliss/p9.0
765
766# Find project to work on
767cd frameworks/base
768</code></pre>
769<p>Let’s setup the remote to Gerrit:</p>
770<pre><code>git review -s
771</code></pre>
772<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>
773<p>However, if this command outputs something like this:</p>
774<pre><code>Could not connect to gerrit.
775Enter your gerrit username:
776</code></pre>
777<p>And after you input your username, it shows something like this:</p>
778<pre><code>Trying again with ssh://username@review.blissroms.com:29418/platform_frameworks_base.git
779&lt;traceback object at 0x7f7f95ea9e18&gt;
780We don't know where your gerrit is. Please manually create a remote named "gerrit" and try again.
781Could not connect to gerrit at ssh://username@review.blissroms.com:29418/platform_frameworks_base.git
782Traceback (most recent call last):
783 File "/usr/bin/git-review", line 10, in &lt;module&gt;
784 sys.exit(main())
785 File "/usr/lib/python2.7/dist-packages/git_review/cmd.py", line 1534, in main
786 sys.exit(e.EXIT_CODE)
787AttributeError: 'GitReviewException' object has no attribute 'EXIT_CODE'
788</code></pre>
789<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>
790<p>As a quick and dirty fix, run this again:</p>
791<pre><code>eval “$(ssh-agent)”
792</code></pre>
793<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>
794<p>Now let’s see if there are any changes we can review.</p>
795<pre><code>git review -l
796</code></pre>
797<p>This outputs:</p>
798<pre><code>2433 new-mm6.0 SystemUI: fix double tap power launching custom lockscreen icon
7992432 new-mm6.0 SystemUI: remove extraneous debug log
800Found 2 items for review
801</code></pre>
802<h4 id="my-output-is-blank-or-different-why">My output is blank (or different.) Why?</h4>
803<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>
804<p>Now you have a list of commits sorted by change number with a description of what changes were made.</p>
805<p>We have a few choices of how to pick commits.</p>
806<h4 id="cherry-picking-commits-to-current-branch">Cherry-picking commits to current branch</h4>
807<pre><code>git review -x changenumber
808</code></pre>
809<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>
810<h4 id="cherry-picking-commits-to-new-branch">Cherry-picking commits to new branch</h4>
811<pre><code>git review -d changenumber
812</code></pre>
813<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>
814<pre><code>Switched to a new branch review/yourusername/changenumber
815</code></pre>
816<p>Now you can review the change. Follow these guidelines:</p>
817<ul>
818<li>Did the ROM build with the change incorporated?</li>
819<li>Did the added feature or fix work in the new build?</li>
820<li>Did the new commit break any other aspects of the build?</li>
821</ul>
822<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>
823<p>Once you're done, return to the base directory (<code>croot</code>) to follow along with the next example!</p>
824<h3 id="submitting-code">Submitting code</h3>
825<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>
826<pre><code>cd frameworks/base
827</code></pre>
828<p>Setup the remote to Gerrit if you haven’t already:</p>
829<pre><code>git review -s
830</code></pre>
831<p>Next, make sure you are on the correct branch:</p>
832<pre><code>git branch -t p9.0 BlissRoms/p9.0
833</code></pre>
834<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>
835<pre><code>git checkout p9.0
836</code></pre>
837<p>This should output:</p>
838<pre><code>Changed to new branch p9.0 tracking upstream BlissRoms/p9.0
839</code></pre>
840<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>
841<pre><code>git review
842</code></pre>
843<p>If you are submitting multiple commits it will ask if you really want to, just type “yes” at the prompt.</p>
844<h3 id="picking-from-other-sources">Picking from other sources</h3>
845<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>
846<p>For this demonstration, I’m going to use LineageOS's Gerrit. Find the commit you want, and note down the commit ID.</p>
847<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>
848<pre><code>git remote add los https://github.com/LineageOS/……(your repo name)
849git remote fetch los lineage-16.0
850</code></pre>
851<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>
852<pre><code>git cherry-pick 9ff831
853</code></pre>
854<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>
855<p>Before pushing and submitting, we need to check if our commit was successfully committed. Type the bottom command:</p>
856<pre><code>git log --oneline
857</code></pre>
858<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>
859<h3 id="conclusion">Conclusion</h3>
860<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>
861<p>-- Vaughn (rwaterspf1)</p>
862<p>-- Eric Park (ideaman924)</p>
863<p>-- Jon West (electrikjesus)</p>
864
865
866
867
868
869
870
871
872
873 </article>
874 </div>
875 </div>
876 </main>
877
878
879<footer class="md-footer">
880
881 <div class="md-footer-nav">
882 <nav class="md-footer-nav__inner md-grid">
883
884 <a href="../" title="Index" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
885 <div class="md-flex__cell md-flex__cell--shrink">
886 <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
887 </div>
888 <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
889 <span class="md-flex__ellipsis">
890 <span class="md-footer-nav__direction">
891 Previous
892 </span>
893 Index
894 </span>
895 </div>
896 </a>
897
898
Eric Park8584eda2019-09-02 09:45:55 +0800899 <a href="../maintaining-proper-authorship/" title="Maintaining proper authorship" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
Eric Parkc9931992019-07-29 13:10:53 +0900900 <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
901 <span class="md-flex__ellipsis">
902 <span class="md-footer-nav__direction">
903 Next
904 </span>
Eric Park8584eda2019-09-02 09:45:55 +0800905 Maintaining proper authorship
Eric Parkc9931992019-07-29 13:10:53 +0900906 </span>
907 </div>
908 <div class="md-flex__cell md-flex__cell--shrink">
909 <i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
910 </div>
911 </a>
912
913 </nav>
914 </div>
915
916 <div class="md-footer-meta md-typeset">
917 <div class="md-footer-meta__inner md-grid">
918 <div class="md-footer-copyright">
919
920 powered by
921 <a href="https://www.mkdocs.org">MkDocs</a>
922 and
923 <a href="https://squidfunk.github.io/mkdocs-material/">
924 Material for MkDocs</a>
925 </div>
926
927 </div>
928 </div>
929</footer>
930
931 </div>
932
933 <script src="../../assets/javascripts/application.245445c6.js"></script>
934
935 <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>
936
937
938 </body>
939</html>