Contributing Changes促成变化

Getting Sources获取来源
Formatting Changes格式更改
Before Submitting提交前
Submitting Changes提交变化
License许可证

Getting Sources获取来源

Mercurial is used to store source code. Mercurial用于存储源代码。The repository can be cloned with the following command:可以使用以下命令克隆存储库

hg clone http://hg.nginx.org/nginx

Formatting Changes格式更改

Changes should be formatted according to the code style used by nginx. 更改应根据nginx使用的代码样式进行格式化。Sometimes, there is no clear rule; in such cases examine how existing nginx sources are formatted and mimic this style. 有时,没有明确的规则;在这种情况下,请检查现有nginx源的格式,并模仿这种样式。Changes will more likely be accepted if style corresponds to the surrounding code.如果样式与周围的代码相对应,则更可能接受更改。

Commit the changes to create a Mercurial changeset. 提交更改以创建Mercurial变更集Please ensure that the specified e-mail address and real name of the change’s author are correct.请确保指定的电子邮件地址和更改作者的真实姓名正确无误。

The commit message should have a single-line synopsis followed by verbose description after an empty line. 提交消息应该有一行摘要,在空行后面跟着详细的描述。It is desirable that the first line is no longer than 67 symbols. 希望第一行不超过67个符号。The resulting changeset as a patch can be obtained using the hg export command:可以使用hg export命令获得作为补丁的结果变更集:

# HG changeset patch # User Filipe Da Silva <username@example.com>
# Date 1368089668 -7200 #      Thu May 09 10:54:28 2013 +0200 # Node ID 2220de0521ca2c0b664a8ea1e201ce1cb90fd7a2 # Parent  822b82191940ef309cd1e6502f94d50d811252a1 Mail: removed surplus ngx_close_connection() call. 
It is already called for a peer connection a few lines above. 
diff -r 822b82191940 -r 2220de0521ca src/mail/ngx_mail_auth_http_module.c --- a/src/mail/ngx_mail_auth_http_module.c      Wed May 15 15:04:49 2013 +0400 +++ b/src/mail/ngx_mail_auth_http_module.c      Thu May 09 10:54:28 2013 +0200 @@ -699,7 +699,6 @@ ngx_mail_auth_http_process_headers(ngx_m 
                     p = ngx_pnalloc(s->connection->pool, ctx->err.len);
                     if (p == NULL) {
-                        ngx_close_connection(ctx->peer.connection);
                         ngx_destroy_pool(ctx->pool);
                         ngx_mail_session_internal_server_error(s);
                         return;

Before Submitting提交前

Several points are worth to consider before submitting changes:在提交变更之前值得考虑的几个要点:

Submitting Changes提交变化

The proposed changes should be sent to the nginx development mailing list. 建议的变更应发送至nginx开发邮件列表。The preferred and convenient method of submitting changesets is with the patchbomb extension.提交变更集的首选且方便的方法是使用patchbomb扩展。

License许可证

Submitting changes implies granting project a permission to use it under an appropriate license.提交更改意味着授予project在适当许可下使用它的权限。