官网

https://gerrit.asterisk.org/Documentation/index.html#_quickstarts


gerrit 的结构

  • 传统项目
    认识 Gerrit

  • gerrit项目
    认识 Gerrit

      引入了一个新的概念 Pending Changes
      所有修改都先发送到Pending Changes, 供其他人查看和讨论
      当足够的Reviewer批准代码更改时, 才可以将更改提交代码库
    

gerrit 的生命周期

  1. Making the change

  2. Creating the review

    """ 提交更改到Pending Change区域 """
    git commit
    
    git push origin HEAD:refs/for/master
    # git push origin HEAD:refs/for/<branch_name>
    
  3. Reviewing the change

     界面操作
     	+2  -->  Looks good to me, approved
     	+1  -->  Looks good to me, but someone else must approve
     	0   -->  No score
     	-1  -->  I would prefer that you didn’t submit this
     	-2  -->  Do not submit
    
  4. Reworking the change

     reviewer 打负分说明需要更改
     Cover Message文本框内可以添加理由
     通知会通过邮件发给Developer
     修改问题后, 再提交审核
    
  5. Verifying the change

     验证可以由自动化工具完成, 也可以手动
     UI界面内提供了每个分支的下载
     Verified 评分+1则验证通过
    
  6. submitting the change

     界面操作
     	在"代码审查"界面打开更改, 并点击"提交"
     	此时更改合并到代码库的master分支中
    

commit-msg Hook

"""
顾名思义, 提交消息挂钩
可以将正在审核的相同更改的不同版本链接在一起
"""

# 本地Git库安装钩子后, 消息如下
Improve foo widget by attaching a bar.

We want a bar, because it improves the foo by providing more
wizbangery to the dowhatimeanery.

Signed-off-by: A. U. Thor <[email protected]>

# 插入新的"Change-ID", 消息如下
Improve foo widget by attaching a bar.

We want a bar, because it improves the foo by providing more
wizbangery to the dowhatimeanery.

Change-Id: Ic8aaa0728a43936cd4c6e1ed590e01ba8f0fbf5b
Signed-off-by: A. U. Thor <[email protected]>

# 获取钩子文件, 使用scp wget curl
scp -p -P 29418 <your username>@<your Gerrit review server>:hooks/commit-msg <local path to your git>/.git/hooks/

# 确保钩子文件可执行
chmod u+s <local path to your git>/.git/hooks/commit-msg

相关文章:

  • 2021-06-09
  • 2021-08-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-30
猜你喜欢
  • 2021-12-23
  • 2021-06-12
  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
  • 2022-02-18
相关资源
相似解决方案