blob: ed48b753ef9486f2dce24c0f36e1497669cb8309 [file] [log] [blame]
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>如何贡献代码 &mdash; singa 2.0.0 documentation</title>
<script type="text/javascript" src="../_static/js/modernizr.min.js"></script>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'../',
VERSION:'2.0.0',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/js/theme.js"></script>
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="源代码库" href="../community/source-repository.html" />
<link rel="prev" title="如何贡献给 SINGA" href="how-contribute.html" />
<link href="../_static/style.css" rel="stylesheet" type="text/css">
<!--link href="../_static/fontawesome-all.min.css" rel="stylesheet" type="text/css"-->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css"
integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<style>
.fa:hover {
opacity: 0.7;
}
.fab:hover {
opacity: 0.7;
}
</style>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../index.html" class="icon icon-home"> singa
<img src="../_static/singa.png" class="logo" alt="Logo"/>
</a>
<div class="version">
latest
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../docs/index.html">文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../downloads.html">下载 SINGA</a></li>
</ul>
<p class="caption"><span class="caption-text">开发</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="schedule.html">开发时间表</a></li>
<li class="toctree-l1"><a class="reference internal" href="how-contribute.html">如何贡献给 SINGA</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">如何贡献代码</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id2">代码风格</a></li>
<li class="toctree-l2"><a class="reference internal" href="#jira">JIRA 格式</a></li>
<li class="toctree-l2"><a class="reference internal" href="#pull-request">Pull Request</a></li>
</ul>
</li>
</ul>
<p class="caption"><span class="caption-text">社区</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../community/source-repository.html">源代码库</a></li>
<li class="toctree-l1"><a class="reference internal" href="../community/mail-lists.html">项目邮件列表</a></li>
<li class="toctree-l1"><a class="reference internal" href="../community/issue-tracking.html">问题追踪</a></li>
<li class="toctree-l1"><a class="reference internal" href="../community/team-list.html">SINGA团队</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../index.html">singa</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../index.html">Docs</a> &raquo;</li>
<li>如何贡献代码</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="id1">
<h1>如何贡献代码<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h1>
<div class="section" id="id2">
<h2>代码风格<a class="headerlink" href="#id2" title="Permalink to this headline"></a></h2>
<p>SINGA 代码库遵循 <a class="reference external" href="http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml">Google C++ 风格指导</a>.</p>
<p>如果想检查你的代码是否符合风格, 你可以用如下 cpplint 工具:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>$ ./tool/cpplint.py YOUR_FILE
</pre></div>
</div>
</div>
<div class="section" id="jira">
<h2>JIRA 格式<a class="headerlink" href="#jira" title="Permalink to this headline"></a></h2>
<p>像其他 Apache 项目一样,SINGA 使用 JIRA 来追踪错误,改进和其他高层讨论(例如,系统设计和功能).
Github pull requests 用于实施讨论,例如代码审查和代码合并.</p>
<ul class="simple">
<li>提供一个描述性标题.</li>
<li>写一个详细的描述. 对于错误报告,这应该最好包括一个问题的短暂再现. 对于新功能,它可能包含一个设计文档.</li>
<li>填写<a class="reference external" href="https://cwiki.apache.org/confluence/display/SPARK/Contributing+to+Spark#ContributingtoSpark-JIRA">必填字段</a></li>
</ul>
</div>
<div class="section" id="pull-request">
<h2>Pull Request<a class="headerlink" href="#pull-request" title="Permalink to this headline"></a></h2>
<p>工作流程是</p>
<ul class="simple">
<li>Fork <a class="reference external" href="https://github.com/apache/singa">SINGA Github repository</a> 到你自己的 Github 帐户.</li>
<li>Clone 你自己的 fork, 创建一个新的 branch (例如, feature-foo or fixbug-foo),
进行这项工作. 完成你的工作后,
<a class="reference external" href="https://git-scm.com/book/en/v2/Git-Branching-Rebasing">rebase</a>
它到当前最新的 master 并 push commits 到你自己的 Github 帐户 (新 branch).</li>
<li>针对 apache / singa 的 master branch 打开一个 pull request.
PR 标题应该是 SINGA-xxxx 的格式,其中 SINGA-xxxx 是相关的JIRA编号,
标题可以是 JIRA 的标题或描述 PR 本身的更具体的标题, 例如,&#8220;SINGA-6 Implement thread-safe singleton&#8220;.
详细描述可以从 JIRA 复制.
考虑确定提交者或者在被改变的代码工作的其他贡献者. 在 Github 中找到文件并点击 &#8220;Blame&#8220; 查看最后修改了代码的逐行注释. 您可以在中添加含有 &#64;username 的 pull request 描述并立即 ping 他们.
请说明你的原创作品和贡献并且您根据项目的开源许可证将工作许可给项目.
进一步向你的新分支进行的提交(例如错误修复)会被 Github 自动添加到这个 pull request.</li>
<li>等待一个提交者查看该补丁. 如果没有冲突,提交者会将其与 master branch 合并.
合并应该 a) 不用 rebase b) 禁用 fast forward merge c) 检查提交消息格式并测试代码/功能.</li>
<li>如果有太多的小提交信息,你会被告知将你的提交压缩成更少的有意义的提交.
如果您的提交信息不符合格式 (如 SINGA-xxxx), 你会被告知重新提交你的提交信息.
这两个更改都可以使用交互式 git rebase. 一旦你得到了更正的提交,
再次将它们推送到你自己的 github. 你的 pull request 会自动更新.
详情请参阅 <a class="reference external" href="https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request">Rebase Pull Requests</a>.</li>
</ul>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../community/source-repository.html" class="btn btn-neutral float-right" title="源代码库" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="how-contribute.html" class="btn btn-neutral float-left" title="如何贡献给 SINGA" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2019 The Apache Software Foundation. All rights reserved. Apache SINGA, Apache, the Apache feather logo, and the Apache SINGA project logos are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book"> singa </span>
v: latest
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">
<dl>
<dt>Languages</dt>
<dd><a href="../../index.html">English</a></dd>
<dd><a href=".././index.html">中文</a></dd>
</dl>
<dl>
<dt>Versions</dt>
<dd><a href="http://singa.apache.org/v0.3.0/">0.3</a></dd>
<dd><a href="http://singa.apache.org/v1.1.0/">1.1</a></dd>
</dl>
</div>
<a href="http://www.apache.org"
style="color:lightblue;padding: 5px; font-size: 10px; text-align: center; text-decoration: none; margin: 5px 2px;">Foundation</a>
<a href="http://www.apache.org/events/current-event"
style="color:lightblue;padding: 5px; font-size: 10px; text-align: center; text-decoration: none; margin: 5px 2px;">Events</a>
<a href="http://www.apache.org/foundation/thanks.html"
style="color:lightblue;padding: 5px; font-size: 10px; text-align: center; text-decoration: none; margin: 5px 2px;">Thanks</a>
<a href="http://www.apache.org/foundation/sponsorship.html"
style="color:lightblue;padding: 5px; font-size: 10px; text-align: center; text-decoration: none; margin: 5px 2px;">Sponsorship</a>
<a href="http://www.apache.org/licenses/"
style="color:lightblue;padding: 5px; font-size: 10px; text-align: center; text-decoration: none; margin: 5px 2px;">License</a>
<br>
<a href="https://github.com/apache/singa" class="fa fa-github"
style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a>
<a href="https://aws.amazon.com/marketplace/seller-profile?id=5bcac385-12c4-4802-aec7-351e09b77b4c" class="fab fa-aws"
style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a>
<a href="https://hub.docker.com/r/apache/singa/" class="fab fa-docker"
style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a>
<a href="https://www.linkedin.com/groups/13550034" class="fa fa-linkedin"
style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a>
<a href="https://twitter.com/ApacheSinga" class="fa fa-twitter"
style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a>
<a href="https://www.facebook.com/Apache-SINGA-347284219056544/" class="fa fa-facebook"
style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a>
<a href="https://www.researchgate.net/project/Apache-SINGA" class="fab fa-researchgate"
style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a>
</div>
<a href="https://github.com/apache/singa">
<img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10000;"
src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png" alt="Fork me on GitHub">
</a>
</body>
</html>