[ English | 한국어 (대한민국) | Indonesia | 中文 (简体, 中国) | español (México) | English (United Kingdom) | Deutsch ]
开发者证书声明 (DCO)¶
为了将您的代码提交到 OpenStack 仓库,您需要同意 开发者证书声明。OpenStack 使用开发者证书声明 (DCO) 作为一种轻量级的方式来确认您有权贡献您提交的代码。这确保了您在项目的许可协议下提供您的贡献,并且您有权这样做。
开发者证书声明如下
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
您对 OpenStack 项目的每次提交都必须由您签名。可以通过在您的提交消息中添加一行来完成
Signed-off-by: Your Name <your.email@example.com>
通过这样做,您证明您有权提交这些代码,并且您是在项目的许可协议下进行提交。
为 DCO 设置您的 Git 配置¶
为了确保您的提交被自动签名,或者为了更容易地手动签名,请确保您配置了您的用户名和电子邮件地址。 Signed-off-by: 行将使用在您的 Git 客户端中配置的名称和电子邮件地址。确保这些设置正确,并且与您用于贡献的名称和电子邮件地址匹配。
然后,您可以使用 -s (或 –signoff) 标志与 git commit 命令一起提交并签名
git commit -s
遵守这些最佳实践将有助于确保您的贡献顺利被接受
始终签名: 每次提交都必须包含 Signed-off-by: 行。如果您修改了提交或重新基于现有更改,即使您不是原始作者,也可能需要对新的提交进行签名。
使用您的真实姓名和电子邮件: Signed-off-by: 行中的姓名和电子邮件地址应与您在 review.opendev.org (Gerrit) 帐户中配置的姓名和电子邮件地址匹配。
重新基于和合并: 在重新基于或合并提交时,会生成新的提交哈希。这意味着您需要重新签名提交。如果您正在交互式地重新基于,请确保对于每个 pick 或 reword 操作,如果您手动运行 git commit,则添加 -s 标志。
示例提交消息¶
带有 DCO 签名的典型提交消息如下所示
Add feature X to OpenStack compute
Introduces a new API endpoint for managing compute instances
more efficiently. Includes updated documentation and tests.
Closes-Bug: #12345
Signed-off-by: Your Name <your.email@example.com>
Change-Id: 8244cbaf1c12ddc90843fe204e107192c96f6bb3
带有多个作者和 DCO 签名的提交消息如下所示
Add feature X to OpenStack compute
Introduces a new API endpoint for managing compute instances
more efficiently. Includes updated documentation and tests.
Closes-Bug: #12345
Co-authored-by: Another Contributor <another.contributor@example.com>
Signed-off-by: Your Name <your.email@example.com>
Signed-off-by: Another Contributor <another.contributor@example.com>
Change-Id: 277ad6ef2721a7081a9db10f63353b407c8b1ca8
注意
后续共同作者或以其他方式帮助引导贡献的开发者必须添加他们自己的 Signed-off-by 声明。 Co-authored-by 条目不是 必需的,因为 Signed-off-by 被视为等效的。 建议使用 Co-authored-by 以适应任何将更改的所有作者信用于的遗留工具。