blob: 1b1172c24369646e1ced006fa77d86477a2bcf86 [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">
240 <a href="../../Bliss OS/installation-guide/" title="Installation Guide" class="md-nav__link">
241 Installation Guide
242 </a>
243 </li>
244
245
246
247
248
249
250
251 <li class="md-nav__item">
252 <a href="../../Bliss OS/troubleshooting/" title="Troubleshooting" class="md-nav__link">
253 Troubleshooting
254 </a>
255 </li>
256
257
258 </ul>
259 </nav>
260 </li>
261
262
263
264
265
266
267
268 <li class="md-nav__item md-nav__item--nested">
269
270 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3">
271
272 <label class="md-nav__link" for="nav-3">
273 BlissRoms
274 </label>
275 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
276 <label class="md-nav__title" for="nav-3">
277 BlissRoms
278 </label>
279 <ul class="md-nav__list" data-md-scrollfix>
280
281
282
283
284
285
286
287 <li class="md-nav__item">
288 <a href="../../BlissRoms/" title="Index" class="md-nav__link">
289 Index
290 </a>
291 </li>
292
293
294
295
296
297
298
299 <li class="md-nav__item">
300 <a href="../../BlissRoms/build-guide/" title="Build Guide" class="md-nav__link">
301 Build Guide
302 </a>
303 </li>
304
305
306
307
308
309
310
311 <li class="md-nav__item">
312 <a href="../../BlissRoms/build-tips/" title="Build Tips" class="md-nav__link">
313 Build Tips
314 </a>
315 </li>
316
317
318 </ul>
319 </nav>
320 </li>
321
322
323
324
325
326
327
328
329
330 <li class="md-nav__item md-nav__item--active md-nav__item--nested">
331
332 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4" checked>
333
334 <label class="md-nav__link" for="nav-4">
335 Common
336 </label>
337 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
338 <label class="md-nav__title" for="nav-4">
339 Common
340 </label>
341 <ul class="md-nav__list" data-md-scrollfix>
342
343
344
345
346
347
348
349 <li class="md-nav__item">
350 <a href="../" title="Index" class="md-nav__link">
351 Index
352 </a>
353 </li>
354
355
356
357
358
359
360
361 <li class="md-nav__item">
362 <a href="../git-started/" title="Git Started" class="md-nav__link">
363 Git Started
364 </a>
365 </li>
366
367
368
369
370
371
372
373
374
375 <li class="md-nav__item md-nav__item--active">
376
377 <input class="md-toggle md-nav__toggle" data-md-toggle="toc" type="checkbox" id="__toc">
378
379
380 <label class="md-nav__link md-nav__link--active" for="__toc">
381 Maintaining proper authorship
382 </label>
383
384 <a href="./" title="Maintaining proper authorship" class="md-nav__link md-nav__link--active">
385 Maintaining proper authorship
386 </a>
387
388
389<nav class="md-nav md-nav--secondary">
390
391
392
393 <label class="md-nav__title" for="__toc">Table of contents</label>
394 <ul class="md-nav__list" data-md-scrollfix>
395
396 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800397 <a href="#what-is-kanging" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800398 What is kanging?
399 </a>
400
401</li>
402
403 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800404 <a href="#why-is-kanging-bad" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800405 Why is kanging bad?
406 </a>
407
408</li>
409
410 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800411 <a href="#kanging-examples-what-you-should-not-do" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800412 Kanging examples (what you should NOT) do
413 </a>
414
415</li>
416
417 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800418 <a href="#how-to-maintain-proper-authorship" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800419 How to maintain proper authorship
420 </a>
421
422</li>
423
424 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800425 <a href="#manually-specifying-an-author" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800426 Manually specifying an author
427 </a>
428
429</li>
430
431
432
433
434
435 </ul>
436
437</nav>
438
439 </li>
440
441
442
443
444
445
446
447 <li class="md-nav__item">
448 <a href="../using-dippy-bird/" title="Using `dippy-bird`" class="md-nav__link">
449 Using `dippy-bird`
450 </a>
451 </li>
452
453
454 </ul>
455 </nav>
456 </li>
457
458
459
460
461
462
463
464 <li class="md-nav__item md-nav__item--nested">
465
466 <input class="md-toggle md-nav__toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
467
468 <label class="md-nav__link" for="nav-5">
469 Infrastructure
470 </label>
471 <nav class="md-nav" data-md-component="collapsible" data-md-level="1">
472 <label class="md-nav__title" for="nav-5">
473 Infrastructure
474 </label>
475 <ul class="md-nav__list" data-md-scrollfix>
476
477
478
479
480
481
482
483 <li class="md-nav__item">
484 <a href="../../infrastructure/" title="Index" class="md-nav__link">
485 Index
486 </a>
487 </li>
488
489
490 </ul>
491 </nav>
492 </li>
493
494
495 </ul>
496</nav>
497 </div>
498 </div>
499 </div>
500
501
502 <div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
503 <div class="md-sidebar__scrollwrap">
504 <div class="md-sidebar__inner">
505
506<nav class="md-nav md-nav--secondary">
507
508
509
510 <label class="md-nav__title" for="__toc">Table of contents</label>
511 <ul class="md-nav__list" data-md-scrollfix>
512
513 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800514 <a href="#what-is-kanging" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800515 What is kanging?
516 </a>
517
518</li>
519
520 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800521 <a href="#why-is-kanging-bad" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800522 Why is kanging bad?
523 </a>
524
525</li>
526
527 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800528 <a href="#kanging-examples-what-you-should-not-do" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800529 Kanging examples (what you should NOT) do
530 </a>
531
532</li>
533
534 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800535 <a href="#how-to-maintain-proper-authorship" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800536 How to maintain proper authorship
537 </a>
538
539</li>
540
541 <li class="md-nav__item">
Eric Park45174ca2019-10-21 01:38:33 +0800542 <a href="#manually-specifying-an-author" class="md-nav__link">
Eric Park8584eda2019-09-02 09:45:55 +0800543 Manually specifying an author
544 </a>
545
546</li>
547
548
549
550
551
552 </ul>
553
554</nav>
555 </div>
556 </div>
557 </div>
558
559
560 <div class="md-content">
561 <article class="md-content__inner md-typeset">
562
563
564
565 <h1>Maintaining proper authorship</h1>
566
567 <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>
568<h2 id="what-is-kanging">What is kanging?</h2>
569<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>
570<h2 id="why-is-kanging-bad">Why is kanging bad?</h2>
571<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>
572<h2 id="kanging-examples-what-you-should-not-do">Kanging examples (what you should NOT) do</h2>
573<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>
574<p><strong>Example 2:</strong> You bring up a bunch of commits, and squash them before pushing to GitHub.</p>
575<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>
576<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>
577<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>
578<p>Example 3 is an example of an intentional kang. We won't explain why because it should be fairly obvious.</p>
579<h2 id="how-to-maintain-proper-authorship">How to maintain proper authorship</h2>
580<p>The process is fairly simple yet important to understand.</p>
581<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>
582<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>
583<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>
584<h2 id="manually-specifying-an-author">Manually specifying an author</h2>
585<p>You need to first determine the original author's name and email address.</p>
586<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>
587<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>
588<p><img alt="commit-page" src="https://i.imgur.com/vKwDGJ5.png" /></p>
589<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>
590<p><img alt="patch-url" src="https://i.imgur.com/jWB8BSD.png" /></p>
591<p>In the patch, find the section that contains the author. It should be at the top of the page.</p>
592<p><img alt="author-information" src="https://i.imgur.com/mUCDtGI.png" /></p>
593<p>Now, it's time to commit with the correct author information. Make the necessary changes, and then commit using this command:</p>
594<pre><code>git commit --author="AUTHOR_INFORMATION_HERE"
595</code></pre>
596<p>Following the example, I would write:</p>
597<pre><code>git commit --author="Eric Park &lt;ideamaneric@gmail.com&gt;"
598</code></pre>
599<p>Once done, push to GitHub or Gerrit.</p>
600
601
602
603
604
605
606
607
608
609 </article>
610 </div>
611 </div>
612 </main>
613
614
615<footer class="md-footer">
616
617 <div class="md-footer-nav">
618 <nav class="md-footer-nav__inner md-grid">
619
620 <a href="../git-started/" title="Git Started" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
621 <div class="md-flex__cell md-flex__cell--shrink">
622 <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
623 </div>
624 <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
625 <span class="md-flex__ellipsis">
626 <span class="md-footer-nav__direction">
627 Previous
628 </span>
629 Git Started
630 </span>
631 </div>
632 </a>
633
634
635 <a href="../using-dippy-bird/" title="Using `dippy-bird`" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
636 <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
637 <span class="md-flex__ellipsis">
638 <span class="md-footer-nav__direction">
639 Next
640 </span>
641 Using `dippy-bird`
642 </span>
643 </div>
644 <div class="md-flex__cell md-flex__cell--shrink">
645 <i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
646 </div>
647 </a>
648
649 </nav>
650 </div>
651
652 <div class="md-footer-meta md-typeset">
653 <div class="md-footer-meta__inner md-grid">
654 <div class="md-footer-copyright">
655
656 powered by
657 <a href="https://www.mkdocs.org">MkDocs</a>
658 and
659 <a href="https://squidfunk.github.io/mkdocs-material/">
660 Material for MkDocs</a>
661 </div>
662
663 </div>
664 </div>
665</footer>
666
667 </div>
668
Eric Park45174ca2019-10-21 01:38:33 +0800669 <script src="../../assets/javascripts/application.ac79c3b0.js"></script>
Eric Park8584eda2019-09-02 09:45:55 +0800670
671 <script>app.initialize({version:"1.0.4",url:{base:"../.."}})</script>
672
673
674 </body>
675</html>