开发、提交、push、入库流程:
repo init -u ssh://gerrit帐号@[ip:port/platform/manifest -b 分支名
repo sync -c -f --no-tags -j1
git commit
git push origin HEAD:refs/for/分支名
有的可能是这样push的: git push ssh://username@ip:port/path_to_module_name HEAD:refs/for/branch_name
path_to_module_name可以通过cat .git/config查看
branch_name可以通过git branch -a命令查看。
push后,gerrit会触发代码静态检查(checkstyle等),根据检查结果做代码修改,修改后使用commit amend重新提交。
在gerrit web中选择Reviewers,进行Code Review。
review通过后,通过Jenkins做编译(将Gerrit的提交号填入Jenkins进行build),编译通过后,在gerrit web中会显示 verified:
verified后,可以点击submit按钮入库。
如果存在release分支,则还需要使用cherry pick操作合并commit到release分支,在release分支中,同样要经历自动化代码静态检查(checkstyle)、Code Review、verify。
verify通过后,可以submit到release分支。
测试团队可以基于release分支编译获得的包做测试。
开发、提交、push、不入库流程:
功能代码没开发完成,可以定期commit、push到gerrit做代码保存。
每天使用repo sync .通过当前模块代码,或者使用repo sync同步所有代码,
sync后,在gerrit web中复制cherry pick 命令,将之前push的代码与sync后的代码做合并,
基于合并后的代码继续开发。