blob: 9f3a53d55b3d651b0cf9644fe74e69294fa508ac [file] [log] [blame]
Eric Park8584eda2019-09-02 09:45:55 +08001
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 Park8584eda2019-09-02 09:45:55 +080036
37
38
39 <title>Maintaining proper authorship - Team Bliss</title>
40
41
42
Eric Park45174ca2019-10-21 01:38:33 +080043 <link rel="stylesheet" href="../../assets/stylesheets/application.30686662.css">
Eric Park8584eda2019-09-02 09:45:55 +080044
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="#what-is-kanging" 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 Maintaining proper authorship
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 Park8584eda2019-09-02 09:45:55 +0800149 <div class="md-main__inner md-grid" data-md-component="container">
150
151
152 <div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
153 <div class="md-sidebar__scrollwrap">
154 <div class="md-sidebar__inner">
155 <nav class="md-nav md-nav--primary" data-md-level="0">
156 <label class="md-nav__title md-nav__title--site" for="__drawer">
157 <a href="../.." title="Team Bliss" class="md-nav__button md-logo">
158
159 <i class="md-icon"></i>
160
161 </a>
162 Team Bliss
163 </label>
164
165 <ul class="md-nav__list" data-md-scrollfix>
166
167
168
169
170
171
172 <li class="md-nav__item">
173 <a href="../.." title="Home" class="md-nav__link">
174 Home
175 </a>
176 </li>
177
178
179
180
181
182
183
184 <li class="md-nav__item md-nav__item--nested">
185
186 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-2" type="checkbox" id="nav-2">
187
188 <label class="md-nav__link" for="nav-2">
189 Bliss OS
190 </label>
191 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
192 <label class="md-nav__title" for="nav-2">
193 Bliss OS
194 </label>
195 <ul class="md-nav__list" data-md-scrollfix>
196
197
198
199
200
201
202
203 <li class="md-nav__item">
204 <a href="../../Bliss OS/" title="Index" class="md-nav__link">
205 Index
206 </a>
207 </li>
208
209
210
211
212
213
214
215 <li class="md-nav__item">
216 <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">
228 <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 Park8584eda2019-09-02 09:45:55 +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
282 </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">
324 <a href="../../BlissRoms/build-guide/" title="Build Guide" class="md-nav__link">
325 Build Guide
326 </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 <li class="md-nav__item">
386 <a href="../git-started/" title="Git Started" class="md-nav__link">
387 Git Started
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 <label class="md-nav__link md-nav__link--active" for="__toc">
405 Maintaining proper authorship
406 </label>
407
408 <a href="./" title="Maintaining proper authorship" class="md-nav__link md-nav__link--active">
409 Maintaining proper authorship
410 </a>
411
412
413<nav class="md-nav md-nav--secondary">
414
415
416
417 <label class="md-nav__title" for="__toc">Table of contents</label>
418 <ul class="md-nav__list" data-md-scrollfix>
419
420 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800421 <a href="#what-is-kanging" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800422 What is kanging?
423 </a>
424
425</li>
426
427 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800428 <a href="#why-is-kanging-bad" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800429 Why is kanging bad?
430 </a>
431
432</li>
433
434 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800435 <a href="#kanging-examples-what-you-should-not-do" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800436 Kanging examples (what you should NOT) do
437 </a>
438
439</li>
440
441 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800442 <a href="#how-to-maintain-proper-authorship" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800443 How to maintain proper authorship
444 </a>
445
446</li>
447
448 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800449 <a href="#manually-specifying-an-author" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800450 Manually specifying an author
451 </a>
452
453</li>
454
455
456
457
458
459 </ul>
460
461</nav>
462
463 </li>
464
465
466
467
468
469
470
471 <li class="md-nav__item">
472 <a href="../using-dippy-bird/" title="Using `dippy-bird`" class="md-nav__link">
473 Using `dippy-bird`
474 </a>
475 </li>
476
477
478 </ul>
479 </nav>
480 </li>
481
482
483
484
485
486
487
488 <li class="md-nav__item md-nav__item--nested">
489
490 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
491
492 <label class="md-nav__link" for="nav-5">
493 Infrastructure
494 </label>
495 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
496 <label class="md-nav__title" for="nav-5">
497 Infrastructure
498 </label>
499 <ul class="md-nav__list" data-md-scrollfix>
500
501
502
503
504
505
506
507 <li class="md-nav__item">
508 <a href="../../infrastructure/" title="Index" class="md-nav__link">
509 Index
510 </a>
511 </li>
512
513
514 </ul>
515 </nav>
516 </li>
517
518
519 </ul>
520</nav>
521 </div>
522 </div>
523 </div>
524
525
526 <div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
527 <div class="md-sidebar__scrollwrap">
528 <div class="md-sidebar__inner">
529
530<nav class="md-nav md-nav--secondary">
531
532
533
534 <label class="md-nav__title" for="__toc">Table of contents</label>
535 <ul class="md-nav__list" data-md-scrollfix>
536
537 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800538 <a href="#what-is-kanging" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800539 What is kanging?
540 </a>
541
542</li>
543
544 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800545 <a href="#why-is-kanging-bad" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800546 Why is kanging bad?
547 </a>
548
549</li>
550
551 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800552 <a href="#kanging-examples-what-you-should-not-do" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800553 Kanging examples (what you should NOT) do
554 </a>
555
556</li>
557
558 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800559 <a href="#how-to-maintain-proper-authorship" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800560 How to maintain proper authorship
561 </a>
562
563</li>
564
565 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800566 <a href="#manually-specifying-an-author" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800567 Manually specifying an author
568 </a>
569
570</li>
571
572
573
574
575
576 </ul>
577
578</nav>
579 </div>
580 </div>
581 </div>
582
583
584 <div class="md-content">
585 <article class="md-content__inner md-typeset">
586
587
588
589 <h1>Maintaining proper authorship</h1>
590
591 <p>One of the most important things you need to keep in mind while working on open-source projects is maintaing correct authorship. In this article, we'll show you why maintaining proper authorship is important, give you a couple examples on correct and incorrect commits, and show you the overall procedure of correctly pulling in commits from others.</p>
592<h2 id="what-is-kanging">What is kanging?</h2>
593<p><a href="https://www.urbandictionary.com/define.php?term=kanged">Kanging</a> is a term used in the Android development community for the action of passing off someone else's code as one's own, intentionally or unintentionally. </p>
594<h2 id="why-is-kanging-bad">Why is kanging bad?</h2>
595<p>Kanging is bad because the developers who worked hard on the commits do not get the recognition they deserve. Over time, this may cause the developer to quit releasing public source code or even retire from the Android development community.</p>
596<h2 id="kanging-examples-what-you-should-not-do">Kanging examples (what you should NOT) do</h2>
597<p><strong>Example 1:</strong> You're trying to cherry-pick some commits from a different repository, but keep running into <code>git merge</code> issues. Out of frustration, you copy the code from the commit, and then just commit it using <code>git commit -a</code>. Satisfied, you push it up to GitHub.</p>
598<p><strong>Example 2:</strong> You bring up a bunch of commits, and squash them before pushing to GitHub.</p>
599<p><strong>Example 3:</strong> You intentionally want to pass off another developer's work as your own. You cherry-pick the commit, and then amend the commit to rewrite the author information.</p>
600<p>Let's go over why this is wrong. Example 1 is an example of an unintentional kang. You didn't want to resolve the <code>git merge</code> issues, so decided to just copy the code and commit it as your own. This is bad because the author information does not get transferred over with your copy, which you have to specify manually.</p>
601<p>Example 2 is more of an accident. If you squash multiple commits, all authorship information for the range of commits is lost. In addition, it becomes a real headache for other developers if something in the range of your commits is wrong. Because you cannot individually revert commits in a squash, squashing is very much discouraged and should ONLY be used when you have a lot of commits that you committed yourself and are small in nature.</p>
602<p>Example 3 is an example of an intentional kang. We won't explain why because it should be fairly obvious.</p>
603<h2 id="how-to-maintain-proper-authorship">How to maintain proper authorship</h2>
604<p>The process is fairly simple yet important to understand.</p>
605<p>If you are cherry-picking commits, the authorship information is transferred automatically. Provided that you are running <code>git cherry-pick &lt;commit-id&gt;</code>, the entire commit information, down to when the commit was created, is picked into your repository. You don't have to do anything in this case.</p>
606<p>If you are committing someone else's code yourself, then you must manually specify who the author is. There are a lot of reasons why you would do this, from merge issues to incompatible code with the existing codebase. To manually specify an author, <a href="#manually-specifying-an-author">follow the steps below.</a></p>
607<p>Finally, do NOT squash a range of commits that are not your own. This completely wipes authorship information from the range of commits and causes a massive headache for other developers.</p>
608<h2 id="manually-specifying-an-author">Manually specifying an author</h2>
609<p>You need to first determine the original author's name and email address.</p>
610<p>GitHub no longer shows the author information when you mouse over the profile picture, which is quite unfortunate. However, there is an easy workaround.</p>
611<p>Go to the commit that you want to pick. <a href="https://github.com/BlissRoms/Documentation-release/commit/5ae1c6c4441786cd3ad5bd1773c831ba13cd86bc">We'll use my commit as an example.</a></p>
612<p><img alt="commit-page" src="https://i.imgur.com/vKwDGJ5.png" /></p>
613<p>Add the word <code>.patch</code>, with the period, to the end of the URL and press Enter to navigate to the raw patch.</p>
614<p><img alt="patch-url" src="https://i.imgur.com/jWB8BSD.png" /></p>
615<p>In the patch, find the section that contains the author. It should be at the top of the page.</p>
616<p><img alt="author-information" src="https://i.imgur.com/mUCDtGI.png" /></p>
617<p>Now, it's time to commit with the correct author information. Make the necessary changes, and then commit using this command:</p>
618<pre><code>git commit --author="AUTHOR_INFORMATION_HERE"
619</code></pre>
620<p>Following the example, I would write:</p>
621<pre><code>git commit --author="Eric Park &lt;ideamaneric@gmail.com&gt;"
622</code></pre>
623<p>Once done, push to GitHub or Gerrit.</p>
624
625
626
627
628
629
630
631
632
633 </article>
634 </div>
635 </div>
636 </main>
637
638
639<footer class="md-footer">
640
641 <div class="md-footer-nav">
642 <nav class="md-footer-nav__inner md-grid">
643
644 <a href="../git-started/" title="Git Started" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
645 <div class="md-flex__cell md-flex__cell--shrink">
646 <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
647 </div>
648 <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
649 <span class="md-flex__ellipsis">
650 <span class="md-footer-nav__direction">
651 Previous
652 </span>
653 Git Started
654 </span>
655 </div>
656 </a>
657
658
659 <a href="../using-dippy-bird/" title="Using `dippy-bird`" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
660 <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
661 <span class="md-flex__ellipsis">
662 <span class="md-footer-nav__direction">
663 Next
664 </span>
665 Using `dippy-bird`
666 </span>
667 </div>
668 <div class="md-flex__cell md-flex__cell--shrink">
669 <i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
670 </div>
671 </a>
672
673 </nav>
674 </div>
675
676 <div class="md-footer-meta md-typeset">
677 <div class="md-footer-meta__inner md-grid">
678 <div class="md-footer-copyright">
679
680 powered by
681 <a href="https://www.mkdocs.org">MkDocs</a>
682 and
683 <a href="https://squidfunk.github.io/mkdocs-material/">
684 Material for MkDocs</a>
685 </div>
686
687 </div>
688 </div>
689</footer>
690
691 </div>
692
Eric Park45174ca2019-10-21 01:38:33 +0800693 <script src="../../assets/javascripts/application.ac79c3b0.js"></script>
Eric Park8584eda2019-09-02 09:45:55 +0800694
695 <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>
696
697
698 </body>
699</html>