git 如何在 Gerrit Code Review 中合并提交

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8550189/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 12:32:36  来源:igfitidea点击:

How to merge commit in Gerrit Code Review

gitmergecommitgerrit

提问by vietstone

I'm newbie to gerrit: http://code.google.com/p/gerrit/I installed it with git on my local Mac. It's done.

我是 gerrit 的新手:http: //code.google.com/p/gerrit/我在本地 Mac 上用 git 安装了它。完成。

I make some test action:

我做了一些测试动作:

  • register 2 accounts, the firstaccounts grant the "Administrators" privilege, the secondaccount grant the "Registered Users"

  • create new project

  • I use the secondaccount to push an commit to master branch for review. Add the firstas reviewer

  • Review is OK. How to merge this commit to main branch? Any solution by web UI?

  • 注册2个账号,第一个账号授予“管理员”权限,第二个账号授予“注册用户”

  • 创建新项目

  • 我使用第二个帐户将提交推送到 master 分支以供审核。添加第一个作为审阅者

  • 审核还行。如何将此提交合并到主分支?Web UI的任何解决方案?

Thank you!

谢谢!

回答by vietstone

I resolved my issue.

我解决了我的问题。

Pay attention to 3 categories on Admin/Project/Access:

注意 Admin/Project/Access 上的 3 个类别:

  • CodeReview
  • Verified
  • Submit
  • 代码
  • 已验证
  • 提交

I miss the 2 last categories, so, Gerrit don't show the submit button

我想念最后两个类别,所以 Gerrit 不显示提交按钮

回答by Brad

Once a commit has the maximum score in each category and no minimum scores in any category, it can be merged. The default categories are Code Review (-2 to +2) and Verified (-1 to +1). So to merge a commit, it must have a +2 Code Review and +1 Verified score, and no -2 Code Review or -1 Verified scores.

一旦提交在每个类别中都有最高分数并且在任何类别中没有最低分数,就可以合并它。默认类别是代码(-2 到 +2)和已验证(-1 到 +1)。因此,要合并提交,它必须具有 +2 代码和 +1 验证分数,并且没有 -2 代码或 -1 验证分数。

A user with 'Submit' privileges will see the 'Submit Patch Set n' button next to the 'Review' button. Click it to merge the commit.

具有“提交”权限的用户将在“审阅”按钮旁边看到“提交补丁集 n”按钮。单击它以合并提交。

回答by Greg Hewgill

The default permissions in Gerrit are not always what you might expect. In order for the first reviewer to be able to submit the review, you will have to give them (well, Administrators) permission to do a "+2" review score.

Gerrit 中的默认权限并不总是您所期望的。为了让第一个评论者能够提交评论,您必须授予他们(好吧,管理员)进行“+2”评论评分的权限。

After you do this and the reviewer marks the commit as +2, then Gerrit will automatically merge the commit into the branch for which it was submitted.

执行此操作后,审阅者将提交标记为 +2,然后 Gerrit 会自动将提交合并到提交的分支中。