blob: 3781cc7574eb11c10368e2ef824a5eee6187d09b [file] [log] [blame]
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="shortcut icon" href="../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.1.2, mkdocs-material-6.0.1">
<title>Maintaining proper authorship - Team Bliss</title>
<link rel="stylesheet" href="../../assets/stylesheets/main.38780c08.min.css">
<link rel="stylesheet" href="../../assets/stylesheets/palette.3f72e892.min.css">
<link href="https://fonts.gstatic.com" rel="preconnect" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400i,700%7CRoboto+Mono&display=fallback">
<style>body,input{font-family:"Roboto",-apple-system,BlinkMacSystemFont,Helvetica,Arial,sans-serif}code,kbd,pre{font-family:"Roboto Mono",SFMono-Regular,Consolas,Menlo,monospace}</style>
</head>
<body dir="ltr" data-md-color-scheme="" data-md-color-primary="none" data-md-color-accent="none">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#what-is-kanging" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header" data-md-component="header">
<nav class="md-header-nav md-grid" aria-label="Header">
<a href="../.." title="Team Bliss" class="md-header-nav__button md-logo" aria-label="Team Bliss">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 003-3 3 3 0 00-3-3 3 3 0 00-3 3 3 3 0 003 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54z"/></svg>
</a>
<label class="md-header-nav__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
</label>
<div class="md-header-nav__title" data-md-component="header-title">
<div class="md-header-nav__ellipsis">
<span class="md-header-nav__topic md-ellipsis">
Team Bliss
</span>
<span class="md-header-nav__topic md-ellipsis">
Maintaining proper authorship
</span>
</div>
</div>
<label class="md-header-nav__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active">
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</label>
<button type="reset" class="md-search__icon md-icon" aria-label="Clear" data-md-component="search-reset" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
</button>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list"></ol>
</div>
</div>
</div>
</div>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="navigation">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../.." title="Team Bliss" class="md-nav__button md-logo" aria-label="Team Bliss">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 003-3 3 3 0 00-3-3 3 3 0 00-3 3 3 3 0 003 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54z"/></svg>
</a>
Team Bliss
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../.." title="Home" class="md-nav__link">
Home
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-2" type="checkbox" id="nav-2">
<label class="md-nav__link" for="nav-2">
Bliss OS
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Bliss OS" data-md-level="1">
<label class="md-nav__title" for="nav-2">
<span class="md-nav__icon md-icon"></span>
Bliss OS
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../Bliss%20OS/" title="Index" class="md-nav__link">
Index
</a>
</li>
<li class="md-nav__item">
<a href="../../Bliss%20OS/build-guide/" title="Build Guide" class="md-nav__link">
Build Guide
</a>
</li>
<li class="md-nav__item">
<a href="../../Bliss%20OS/extras/" title="Extras" class="md-nav__link">
Extras
</a>
</li>
<li class="md-nav__item">
<a href="../../Bliss%20OS/installation-guide-misc/" title="Installation Guide (Misc)" class="md-nav__link">
Installation Guide (Misc)
</a>
</li>
<li class="md-nav__item">
<a href="../../Bliss%20OS/installation-guide-surface-devices/" title="Installation Guide (Surface devices)" class="md-nav__link">
Installation Guide (Surface devices)
</a>
</li>
<li class="md-nav__item">
<a href="../../Bliss%20OS/installation-guide/" title="Installation Guide" class="md-nav__link">
Installation Guide
</a>
</li>
<li class="md-nav__item">
<a href="../../Bliss%20OS/taking-bug-reports/" title="Taking bug reports" class="md-nav__link">
Taking bug reports
</a>
</li>
<li class="md-nav__item">
<a href="../../Bliss%20OS/troubleshooting/" title="Troubleshooting" class="md-nav__link">
Troubleshooting
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-3" type="checkbox" id="nav-3">
<label class="md-nav__link" for="nav-3">
BlissRoms
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="BlissRoms" data-md-level="1">
<label class="md-nav__title" for="nav-3">
<span class="md-nav__icon md-icon"></span>
BlissRoms
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../BlissRoms/" title="Index" class="md-nav__link">
Index
</a>
</li>
<li class="md-nav__item">
<a href="../../BlissRoms/build-guide/" title="Build Guide" class="md-nav__link">
Build Guide
</a>
</li>
<li class="md-nav__item">
<a href="../../BlissRoms/build-tips/" title="Build Tips" class="md-nav__link">
Build Tips
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-4" type="checkbox" id="nav-4" checked>
<label class="md-nav__link" for="nav-4">
Common
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Common" data-md-level="1">
<label class="md-nav__title" for="nav-4">
<span class="md-nav__icon md-icon"></span>
Common
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../" title="Index" class="md-nav__link">
Index
</a>
</li>
<li class="md-nav__item">
<a href="../git-started/" title="Git Started" class="md-nav__link">
Git Started
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
Maintaining proper authorship
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" title="Maintaining proper authorship" class="md-nav__link md-nav__link--active">
Maintaining proper authorship
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#what-is-kanging" class="md-nav__link">
What is kanging?
</a>
</li>
<li class="md-nav__item">
<a href="#why-is-kanging-bad" class="md-nav__link">
Why is kanging bad?
</a>
</li>
<li class="md-nav__item">
<a href="#kanging-examples-what-you-should-not-do" class="md-nav__link">
Kanging examples (what you should NOT) do
</a>
</li>
<li class="md-nav__item">
<a href="#how-to-maintain-proper-authorship" class="md-nav__link">
How to maintain proper authorship
</a>
</li>
<li class="md-nav__item">
<a href="#manually-specifying-an-author" class="md-nav__link">
Manually specifying an author
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../using-dippy-bird/" title="Using `dippy-bird`" class="md-nav__link">
Using `dippy-bird`
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle" data-md-toggle="nav-5" type="checkbox" id="nav-5">
<label class="md-nav__link" for="nav-5">
Infrastructure
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" aria-label="Infrastructure" data-md-level="1">
<label class="md-nav__title" for="nav-5">
<span class="md-nav__icon md-icon"></span>
Infrastructure
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../infrastructure/" title="Index" class="md-nav__link">
Index
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="toc">
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="#what-is-kanging" class="md-nav__link">
What is kanging?
</a>
</li>
<li class="md-nav__item">
<a href="#why-is-kanging-bad" class="md-nav__link">
Why is kanging bad?
</a>
</li>
<li class="md-nav__item">
<a href="#kanging-examples-what-you-should-not-do" class="md-nav__link">
Kanging examples (what you should NOT) do
</a>
</li>
<li class="md-nav__item">
<a href="#how-to-maintain-proper-authorship" class="md-nav__link">
How to maintain proper authorship
</a>
</li>
<li class="md-nav__item">
<a href="#manually-specifying-an-author" class="md-nav__link">
Manually specifying an author
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content">
<article class="md-content__inner md-typeset">
<h1>Maintaining proper authorship</h1>
<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>
<h2 id="what-is-kanging">What is kanging?</h2>
<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>
<h2 id="why-is-kanging-bad">Why is kanging bad?</h2>
<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>
<h2 id="kanging-examples-what-you-should-not-do">Kanging examples (what you should NOT) do</h2>
<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>
<p><strong>Example 2:</strong> You bring up a bunch of commits, and squash them before pushing to GitHub.</p>
<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>
<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>
<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>
<p>Example 3 is an example of an intentional kang. We won't explain why because it should be fairly obvious.</p>
<h2 id="how-to-maintain-proper-authorship">How to maintain proper authorship</h2>
<p>The process is fairly simple yet important to understand.</p>
<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>
<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>
<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>
<h2 id="manually-specifying-an-author">Manually specifying an author</h2>
<p>You need to first determine the original author's name and email address.</p>
<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>
<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>
<p><img alt="commit-page" src="https://i.imgur.com/vKwDGJ5.png" /></p>
<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>
<p><img alt="patch-url" src="https://i.imgur.com/jWB8BSD.png" /></p>
<p>In the patch, find the section that contains the author. It should be at the top of the page.</p>
<p><img alt="author-information" src="https://i.imgur.com/mUCDtGI.png" /></p>
<p>Now, it's time to commit with the correct author information. Make the necessary changes, and then commit using this command:</p>
<pre><code>git commit --author="AUTHOR_INFORMATION_HERE"
</code></pre>
<p>Following the example, I would write:</p>
<pre><code>git commit --author="Eric Park &lt;ideamaneric@gmail.com&gt;"
</code></pre>
<p>Once done, push to GitHub or Gerrit.</p>
</article>
</div>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-nav">
<nav class="md-footer-nav__inner md-grid" aria-label="Footer">
<a href="../git-started/" title="Git Started" class="md-footer-nav__link md-footer-nav__link--prev" rel="prev">
<div class="md-footer-nav__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</div>
<div class="md-footer-nav__title">
<div class="md-ellipsis">
<span class="md-footer-nav__direction">
Previous
</span>
Git Started
</div>
</div>
</a>
<a href="../using-dippy-bird/" title="Using `dippy-bird`" class="md-footer-nav__link md-footer-nav__link--next" rel="next">
<div class="md-footer-nav__title">
<div class="md-ellipsis">
<span class="md-footer-nav__direction">
Next
</span>
Using `dippy-bird`
</div>
</div>
<div class="md-footer-nav__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
</div>
</a>
</nav>
</div>
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-footer-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
</div>
</div>
</footer>
</div>
<script src="../../assets/javascripts/vendor.77e55a48.min.js"></script>
<script src="../../assets/javascripts/bundle.aa3f9871.min.js"></script><script id="__lang" type="application/json">{"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing"}</script>
<script>
app = initialize({
base: "../..",
features: [],
search: Object.assign({
worker: "../../assets/javascripts/worker/search.4ac00218.min.js"
}, typeof search !== "undefined" && search)
})
</script>
</body>
</html>