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