blob: aec57bb71cf2c7be43d942623a4761a4c9a710cc [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">
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 Park8584eda2019-09-02 09:45:55 +0800288 <a href="../../Bliss OS/troubleshooting/" title="Troubleshooting" class="md-nav__link">
289 Troubleshooting
290 </a>
291 </li>
292
293
294 </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">
336 <a href="../../BlissRoms/build-guide/" title="Build Guide" class="md-nav__link">
337 Build Guide
338 </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 <li class="md-nav__item">
398 <a href="../git-started/" title="Git Started" class="md-nav__link">
399 Git Started
400 </a>
401 </li>
402
403
404
405
406
407
408
409
410
411 <li class="md-nav__item md-nav__item--active">
412
413 <input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
414
415
416 <label class="md-nav__link md-nav__link--active" for="__toc">
417 Maintaining proper authorship
418 </label>
419
420 <a href="./" title="Maintaining proper authorship" class="md-nav__link md-nav__link--active">
421 Maintaining proper authorship
422 </a>
423
424
425<nav class="md-nav md-nav--secondary">
426
427
428
429 <label class="md-nav__title" for="__toc">Table of contents</label>
430 <ul class="md-nav__list" data-md-scrollfix>
431
432 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800433 <a href="#what-is-kanging" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800434 What is kanging?
435 </a>
436
437</li>
438
439 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800440 <a href="#why-is-kanging-bad" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800441 Why is kanging bad?
442 </a>
443
444</li>
445
446 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800447 <a href="#kanging-examples-what-you-should-not-do" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800448 Kanging examples (what you should NOT) do
449 </a>
450
451</li>
452
453 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800454 <a href="#how-to-maintain-proper-authorship" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800455 How to maintain proper authorship
456 </a>
457
458</li>
459
460 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800461 <a href="#manually-specifying-an-author" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800462 Manually specifying an author
463 </a>
464
465</li>
466
467
468
469
470
471 </ul>
472
473</nav>
474
475 </li>
476
477
478
479
480
481
482
483 <li class="md-nav__item">
484 <a href="../using-dippy-bird/" title="Using `dippy-bird`" class="md-nav__link">
485 Using `dippy-bird`
486 </a>
487 </li>
488
489
490 </ul>
491 </nav>
492 </li>
493
494
495
496
497
498
499
500 <li class="md-nav__item md-nav__item--nested">
501
502 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
503
504 <label class="md-nav__link" for="nav-5">
505 Infrastructure
506 </label>
507 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
508 <label class="md-nav__title" for="nav-5">
509 Infrastructure
510 </label>
511 <ul class="md-nav__list" data-md-scrollfix>
512
513
514
515
516
517
518
519 <li class="md-nav__item">
520 <a href="../../infrastructure/" title="Index" class="md-nav__link">
521 Index
522 </a>
523 </li>
524
525
526 </ul>
527 </nav>
528 </li>
529
530
531 </ul>
532</nav>
533 </div>
534 </div>
535 </div>
536
537
538 <div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
539 <div class="md-sidebar__scrollwrap">
540 <div class="md-sidebar__inner">
541
542<nav class="md-nav md-nav--secondary">
543
544
545
546 <label class="md-nav__title" for="__toc">Table of contents</label>
547 <ul class="md-nav__list" data-md-scrollfix>
548
549 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800550 <a href="#what-is-kanging" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800551 What is kanging?
552 </a>
553
554</li>
555
556 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800557 <a href="#why-is-kanging-bad" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800558 Why is kanging bad?
559 </a>
560
561</li>
562
563 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800564 <a href="#kanging-examples-what-you-should-not-do" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800565 Kanging examples (what you should NOT) do
566 </a>
567
568</li>
569
570 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800571 <a href="#how-to-maintain-proper-authorship" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800572 How to maintain proper authorship
573 </a>
574
575</li>
576
577 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800578 <a href="#manually-specifying-an-author" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800579 Manually specifying an author
580 </a>
581
582</li>
583
584
585
586
587
588 </ul>
589
590</nav>
591 </div>
592 </div>
593 </div>
594
595
596 <div class="md-content">
597 <article class="md-content__inner md-typeset">
598
599
600
601 <h1>Maintaining proper authorship</h1>
602
603 <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>
604<h2 id="what-is-kanging">What is kanging?</h2>
605<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>
606<h2 id="why-is-kanging-bad">Why is kanging bad?</h2>
607<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>
608<h2 id="kanging-examples-what-you-should-not-do">Kanging examples (what you should NOT) do</h2>
609<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>
610<p><strong>Example 2:</strong> You bring up a bunch of commits, and squash them before pushing to GitHub.</p>
611<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>
612<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>
613<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>
614<p>Example 3 is an example of an intentional kang. We won't explain why because it should be fairly obvious.</p>
615<h2 id="how-to-maintain-proper-authorship">How to maintain proper authorship</h2>
616<p>The process is fairly simple yet important to understand.</p>
617<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>
618<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>
619<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>
620<h2 id="manually-specifying-an-author">Manually specifying an author</h2>
621<p>You need to first determine the original author's name and email address.</p>
622<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>
623<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>
624<p><img alt="commit-page" src="https://i.imgur.com/vKwDGJ5.png" /></p>
625<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>
626<p><img alt="patch-url" src="https://i.imgur.com/jWB8BSD.png" /></p>
627<p>In the patch, find the section that contains the author. It should be at the top of the page.</p>
628<p><img alt="author-information" src="https://i.imgur.com/mUCDtGI.png" /></p>
629<p>Now, it's time to commit with the correct author information. Make the necessary changes, and then commit using this command:</p>
630<pre><code>git commit --author="AUTHOR_INFORMATION_HERE"
631</code></pre>
632<p>Following the example, I would write:</p>
633<pre><code>git commit --author="Eric Park &lt;ideamaneric@gmail.com&gt;"
634</code></pre>
635<p>Once done, push to GitHub or Gerrit.</p>
636
637
638
639
640
641
642
643
644
645 </article>
646 </div>
647 </div>
648 </main>
649
650
651<footer class="md-footer">
652
653 <div class="md-footer-nav">
654 <nav class="md-footer-nav__inner md-grid">
655
656 <a href="../git-started/" title="Git Started" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
657 <div class="md-flex__cell md-flex__cell--shrink">
658 <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
659 </div>
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 Previous
664 </span>
665 Git Started
666 </span>
667 </div>
668 </a>
669
670
671 <a href="../using-dippy-bird/" title="Using `dippy-bird`" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
672 <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
673 <span class="md-flex__ellipsis">
674 <span class="md-footer-nav__direction">
675 Next
676 </span>
677 Using `dippy-bird`
678 </span>
679 </div>
680 <div class="md-flex__cell md-flex__cell--shrink">
681 <i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
682 </div>
683 </a>
684
685 </nav>
686 </div>
687
688 <div class="md-footer-meta md-typeset">
689 <div class="md-footer-meta__inner md-grid">
690 <div class="md-footer-copyright">
691
692 powered by
693 <a href="https://www.mkdocs.org">MkDocs</a>
694 and
695 <a href="https://squidfunk.github.io/mkdocs-material/">
696 Material for MkDocs</a>
697 </div>
698
699 </div>
700 </div>
701</footer>
702
703 </div>
704
Eric Park45174ca2019-10-21 01:38:33 +0800705 <script src="../../assets/javascripts/application.ac79c3b0.js"></script>
Eric Park8584eda2019-09-02 09:45:55 +0800706
707 <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>
708
709
710 </body>
711</html>