Glusterfs开源社区使用 Git + Gerrit + Jenkins的开发流程。
Register
Sign up for an account at http://review.gluster.org by clicking 'Register' on the right-hand top. You can use yourgmail login as the openID identity.
首先需要去 http://review.gluster.org 注册一个账号,你需要有gmail账号或者其他OpenID账号来注册和登陆。
SSH keys
Provide your SSH public key into Gerrit so that you can successfully access the development git repo as well as push changes for review/merge.
然后需要向Gerrit提供你的SSH公钥,这样你才能访问开发代码库,以及提交代码。
Settings -> SSH Public Keys -> Add Key...
Clone a working tree
Get yourself a working tree by cloning the development repository from Gerrit
$ git clone ssh://[username@]git.gluster.org/glusterfs.git glusterfs
克隆git库,获得代码
修改代码...
在修改代码之前,将以下两行加入glusterfs/.git/config
[user] email = [your.email] name = [your.name]
Typically you would have a local branch per task, and most of the times that branch will have one commit.
再创建一个本地分支,通常是一个修改/commit对应一个分支。
Commit
You will need to sign-off your commit (git commit -s) before sending the patch for review. By signing off your patch, you agree to the terms listed under "Developer's Certificate of Origin" section in the CONTRIBUTING file available in the repository root.
Provide a meaningful commit message. Your commit message should be in the following format
A short one line subject describing what the patch accomplishes An empty line following the subject Situation necessitating the patch Description of the code changes Reason for doing it this way (compared to others) Description of test cases
在向社区提交你的代码之前,你需要在你的patch上签名(git commit -s), 这样就表示你同意CONTRIBUTING文件中Developer's Certificate of Origin一节列出的条款。
你需要按照以下格式写commit message
rfc.sh
After doing the local commit, it is time to submit the code for review. There is a script available inside glusterfs.git called rfc.sh. You can submit your changes for review by simply executing
$ ./rfc.sh
Prompt for a Bug Id for each commit (if it was not already provded) and include it as a "BUG:" tag in the commit log. You can just hit <enter> at this prompt if your submission is purely for review purposes.
在提交了本地commit后, 接下来将commit提交代码审查。在代码库里面有一个rfc.sh脚本。简单执行下这个脚本就提交commit了。
脚本执行过程中,会提示你输入bug id, 这个是必须有的,不然社区的人会提醒你. :-/
如果没有,可用先向redhat bugzilla提一个。
Amend
Code review comments are notified via email. After incorporating the changes in code, you can mark each of the inline comment as 'done' (optional). After all the changes to your local files, amend the previous commit with these changes with -
$ git commit -a --amend $ ./rfc.sh
代码审查意见会以邮件的形式通知。在对代码进行相应的修改后,你可以使用以下命令再次提交代码。
以上是社区开发的基本流程,全部流程在:
http://www.gluster.org/community/documentation/index.php/Development_Work_Flow
转自:http://glusterfs.iteye.com/blog/1833389