| <html devsite><head> |
| <title>查看补丁程序</title> |
| <meta name="project_path" value="/_project.yaml"/> |
| <meta name="book_path" value="/_book.yaml"/> |
| </head> |
| <body> |
| <!-- |
| Copyright 2017 The Android Open Source Project |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <p> |
| 如果您要查看 Android 开源项目的所有补丁程序,或者要查看或验证某项更改,请参阅 <a href="https://www.google.com/url?sa=D&q=https%3A%2F%2Fandroid-review.googlesource.com%2F%23%2Fq%2Fstatus%3Aopen%2BOR%2Bstatus%3Aclosed">AOSP Gerrit</a>。要详细了解如何查找某项具体的更改,请参阅 <a href="https://gerrit-review.googlesource.com/Documentation/user-search.html">Gerrit 代码审核 - 搜索更改</a>。 |
| </p> |
| |
| <h2 id="reviewing-a-change">审核更改</h2> |
| |
| <p> |
| 如果您被指定为某项更改的审核者,则需要确定以下几点:<em></em></p> |
| |
| <ul> |
| <li>这项更改是否符合此项目的既定目的?</li> |
| <li>这项更改在项目的现有架构中是否有效? |
| </li> |
| <li>这项更改是否会引入会在将来造成问题的设计缺陷?</li> |
| <li>这项更改是否遵循了针对此项目制定的最佳做法?</li> |
| <li>这项更改是否是执行所述功能的绝佳方式?</li> |
| <li>这项更改是否会带来任何安全风险或不稳定性方面的风险?</li> |
| </ul> |
| |
| <p>如果您要批准这项更改,请在 Gerrit 中将其标记为 LGTM(“看起来不错”)。 |
| </p> |
| |
| <h2 id="verifying-a-change">验证更改</h2> |
| |
| <p> |
| 如果您被指定为某项更改的验证者,则需要执行以下工作:<em></em></p> |
| |
| <ul> |
| <li>使用其中一种下载命令将更改以补丁程序的形式添加到自己的本地客户端。</li> |
| <li>编译并测试更改内容。</li> |
| <li>在 Gerrit 中选择 <strong>Reply</strong>(回复)按钮。系统会打开一个注释框,您可以选择是否在此框中将更改标记为“Verified”(已验证),并添加一条消息说明发现了哪些问题。<em></em></li> |
| </ul> |
| |
| <h2 id="downloading-changes-from-gerrit">从 Gerrit 下载更改内容</h2> |
| |
| <p> |
| 已验证并合并的提交内容将在下一次运行 <code>repo sync</code> 时下载。如果您想下载尚未获得批准的特定更改,请运行以下命令: |
| </p> |
| |
| <pre class="devsite-terminal devsite-click-to-copy"> |
| repo download <var>TARGET CHANGE</var></pre> |
| |
| <p>其中 <code><var>TARGET</var></code> 是更改应该下载到的本地目录,<code><var>CHANGE</var></code> 是 Gerrit 中列出的更改编号。如需了解详细信息,请参阅 <a href="/setup/using-repo.html">Repo 参考资料</a>。 |
| </p> |
| |
| <h2 id="how-do-i-become-a-verifier-or-reviewer">如何成为验证者或审核者?</h2> |
| |
| <p>简言之,为一个或多个 Android 项目贡献高质量代码。要详细了解 Android 开源社区中的不同角色以及谁在担任这些角色,请参阅<a href="/setup/roles.html">项目角色</a>。 |
| </p> |
| |
| <h2 id="diffs-and-comments">差异和注释</h2> |
| |
| <p> |
| 要在 Gerrit 中打开某项更改的详细信息,请点击这项更改的“Id number”(ID 号)或“Subject”(主题)。<em></em><em></em>要比较原有代码与更新后的代码,请点击“Side-by-side diffs”(并排显示差异)下的文件名。<em></em> |
| </p> |
| |
| <h2 id="adding-comments">添加注释</h2> |
| |
| <p>社区中的任何人都可以使用 Gerrit 为提交的代码添加代码内注释。如果注释内容与 Gerrit 中其所依附的代码行或代码段相关,那就是一条好注释。注释可能是关于如何改进一行代码的简短而有建设性的建议,也可能是作者对于为什么这样编写代码的解释。 |
| </p> |
| |
| <p>要添加代码内注释,请双击代码的相关行,然后在打开的文本框中编写注释。点击“<strong>Save</strong>”(保存)后,只有您可以看到自己的注释。 |
| </p> |
| |
| <p>要发布注释以便让其他使用 Gerrit 的人可以看到,请点击“Publish Comments”(发布注释)按钮。您的注释将通过电子邮件发送给这项更改的所有相关方,包括更改的所有者、补丁程序集上传者(如果与所有者不同)以及所有当前审核者。 |
| </p> |
| |
| </body></html> |