LoginSignup
2
2

More than 5 years have passed since last update.

nginxの開発MLにパッチを送る

Last updated at Posted at 2013-06-15

先日nginxでValgrindの警告を消すパッチを開発メーリングリストに投稿した時のメモ。

nginxはバージョン管理にMercurialを使っている。Mercurialには指定したリビジョンのコミットからパッチを生成するコマンドと、パッチファイルをコミットとして取り込むコマンドがあるので単なるunified diffテキストを送るよりはこれを使う方が良さげ。

パッチ作成対象のコミットは以下のリビジョンのもの。なお、これ自体は既にnginx本体に取り込まれたものなので、実際に送ったパッチやその際のやりとりについてはこちらのスレッドを参照。

$ hg log -r 5252
changeset:   5252:982678c5c270
tag:         tip
user:        Tatsuhiko Kubo <cubicdaiya@gmail.com>
date:        Wed Jun 12 00:41:24 2013 +0900
files:       src/os/unix/ngx_channel.c
description:
Valgrind: another complaint about uninitialized bytes.


$

コミットからパッチを作成するにはexportコマンドを使用する。

$ hg export 5252
# HG changeset patch
# User Tatsuhiko Kubo <cubicdaiya@gmail.com>
# Date 1370965284 -32400
#      Wed Jun 12 00:41:24 2013 +0900
# Node ID 982678c5c270f93a0c21ab6eb23cb123c0dc3df0
# Parent  4ef49081ef4c261a2138aeb4944be0afeee5a586
Valgrind: another complaint about uninitialized bytes.

diff -r 4ef49081ef4c -r 982678c5c270 src/os/unix/ngx_channel.c
--- a/src/os/unix/ngx_channel.c Thu Jun 13 16:28:42 2013 +0400
+++ b/src/os/unix/ngx_channel.c Wed Jun 12 00:41:24 2013 +0900
@@ -34,6 +34,8 @@
         msg.msg_control = (caddr_t) &cmsg;
         msg.msg_controllen = sizeof(cmsg);

+        ngx_memzero(&cmsg, sizeof(cmsg));
+
         cmsg.cm.cmsg_len = CMSG_LEN(sizeof(int));
         cmsg.cm.cmsg_level = SOL_SOCKET;
         cmsg.cm.cmsg_type = SCM_RIGHTS;
$

exportコマンドの出力にはコミットの作成者や変更元のリビジョンのハッシュ値(Parent)も含まれるのでパッチを取り込む側にとっては何かと都合が良い。また、リビジョン番号の代わりにコミットのハッシュ値でもできるし、この場合はtip(gitでいうHEAD)でもパッチが作れる。

$ hg export tip
       ・
    (中略)$ hg export 982678c5c270
       ・
    (中略)$

あとは生成したパッチを添付したメールをnginx-devel@nginx.orgに送ればいい。なお、nginxのMercurialリポジトリは以下のURLからcloneできる。

$ hg clone http://hg.nginx.org/nginx
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2