是否可以通过提交消息在gerrit中添加审阅者?请考虑此提交消息:

component: make foo more bar

Foo was not bar enough, this change adds more bar to make foo fit better
in baz.

Change-Id: I4724e283214e0bfbb85a8e3d8db4971618e2609a
Cc: [email protected]
Cc: [email protected]

在这里,[email protected][email protected]必须作为审阅者添加到gerrit中。
我知道有一个special branch specifier来添加审阅者,但希望在创建提交时有更自动化的东西。这些更改是独立的,不过如果我可以将它们分组到主题分支上会更好,因为它们是相关的。

最佳答案

几乎没有其他方法可以做到这一点。
只需将这些行添加到.git/config
[远程“审查”]
pushurl=ssh://user@gerrit:29418/project
push=头:refs/for/master
receive pack=git接收包--审阅者审阅者1--审阅者
审阅者2
现在,当您想推送评论时,只需执行:git push review和“reviewer1”和“reviewer2”将添加到您的补丁集中。
我认为您还可以编写一些脚本/钩子来实现自动化。提交后,只需grep提交的更改id,并将其与以下gerrit命令一起使用:
ssh-p gerrit set reviewers[--project(project)-p
(项目)][--添加(审阅者)…-A(审阅者)…][--]{提交|
变更标识}
示例:ssh-p 29418 gerrit.example.com gerrit set reviewers-a
[email protected]邮箱:iac6b2ac2
我希望它能帮助你:)

08-27 18:40