Gerrit 相关

  1. Gerrit的commit-msg hook
    https://blog.csdn.net/taiyangdao/article/details/71079021

  2. Gerrit 添加review



# 1 @PLUGIN@ plugin
[reviewers]
    enableREST = true
    enableUI = true


# 2 reviewers.config
[filter "file:^build/modules/.*"]
    reviewer = john.doe@example.com

  [filter "file:^build/.*"]
    reviewer = jane.doe@example.com

# CLI的方法
1)git fetch “<<fetch URL>>” refs/meta/config
2)git checkout FETCH_HEAD
3)vim “reviewers.config” (add the required contents and save and quit)
4)git add “reviewers.config”
5)git commit -m “commit message”
6)git push origin HEAD:refs/meta/config
7)git checkout “master”(or the branch which you are working on)

  1. Special and magic references
# Special references
refs/changes/*          #用于存储审查的补丁
refs/meta/config        #项目配置的分支
refs/meta/dashboards/*  #
refs/notes/review       #保存代码审查信息的分支


# Magic references
refs/for/<branch ref>  #进行代码审查时需要提交代码到这个命名空间
refs/publish/*         #和refs/for/*命名空间作用一样
refs/drafts/*          #用于草案代码审查,和refs/for/*的区别在于只有部分人可见


# 简单点说
refs/for/mybranch需要经过code review之后才可以提交;
refs/heads/mybranch不需要code review。



  1. 配置快捷git push
git config remote.origin.push HEAD:refs/for/master
posted @ 2021-02-05 17:43  该显示昵称已被使用了  阅读(110)  评论(0)    收藏  举报