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