将请求转移到gerrit
prtogerrit的Python项目详细描述
这是Mike正在处理的一个脚本,用于从 Github和Bitbucket进入Gerrit。
要求
你需要一个可用的gerrit运行实例,而且你必须 本地安装的git-review工具。
安装
pip install prtogerrit
配置
创建新文件${home}/.prtogerrit.config。在里面,放置说明 关于git存储库在哪里,以及gerrit的哪个部分 您想让他们去的服务器:
# place this file in $HOME/.prtogerrit.config [myproject_github] gerrit=https://gerrit.myproject.com/ service=github repo=myusername/myproject username=myusername password=foobar [myproject_bitbucket] gerrit=https://gerrit.myproject.com/ service=bitbucket repo=myusername/myproject username=myusername password=foobar
运行它
要使用该脚本,假设您在“myproject”上收到了14号pull请求 在Github。转到git工作目录,选择所需的分支 (通常是master),然后键入:
prtogerrit myproject_github 14
如果pull请求完全合并,就这样!脚本将与 github api,获取pull请求14的分支信息,压缩合并 它将成为一个新的本地分支,名为“myproject_github_14”,然后将 用“git review”把它推上去。它还将关闭拉取请求并 为参与者添加如何查找评论的注释。
冲突
如果挤压合并有冲突,prtogerrit将停止并让您更正 通过使用“git add<;filename>;”进行更改,就像任何其他合并一样 决议。然后使用--continue:
再次运行该命令prtogerrit myproject_github 14 --continue