gerrit 默认提供2个label。
Label: Code-Review
他的值可以是 -2 ~ +2 之间
-2表示 这个提交不应该被合入,
-1
0
+1
+2 只有+2了之后这个提交才能被合入,也就是submit那个按钮才会出现。 Any +2 enables submit
Label: Verified
-1 Fails
Tried to compile, but got a compile error, or tried to run tests, but one or more tests did not pass.
Any -1 blocks submit.
0 No score
Didn’t try to perform the verification tasks.
+1 Verified
Compiled (and ran tests) successfully.
Any +1 enables submit.
这2个标签都是在All-Projects仓库的refs/meta/config 下面的 project.config 文件中配置的。
[label "Code-Review"]
function = MaxWithBlock
copyMinScore = true
value = -2 This shall not be merged
value = -1 I would prefer this is not merged as is
value = 0 No score
value = +1 Looks good to me, but someone else must approve
value = +2 Looks good to me, approved
[label "Verified"]
value = -1 Fails
value = 0 No score
value = +1 Verified
当然我们可以自己添加 自定义的 标签
label.Label-Name
The name for a label, consisting only of alphanumeric characters and -.
label.Label-Name.value
A multi-valued key whose values are of the form "<#> Value description text". The <#> may be any positive or negative number with an optional leading +.
label.Label-Name.defaultValue
The default value (or score) for the label. The defaultValue must be within the range of valid label values. It is an optional label setting, if not defined the defaultValue for the label will be 0. When a defaultValue is defined,