有关“Gerrit变更编号”的官方文件 [英] Official documentation about "Gerrit Change Number"

查看:164
本文介绍了有关“Gerrit变更编号”的官方文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的另一个问题的后续问题: Gerrit评论网址中的数字的官方名称是什么



我现在已经了解到嵌入在Gerrit网址中的小整数称为 Gerrit更改号码,有时也称为数字更改号码。例如,它是以下Gerrit网址中 68 的数字

  http:// gerrithost:8080/68 

这个数字在理解Gerrit工作流程中起着重要作用,但关于它的讨论并不多。我甚至有一种感觉,它可能已被弃用(因为 Change-Id - 以字符I为前缀的长哈希字符串 - 也唯一标识gerrit 更改
$ b $ pre $ Change-Id:Ic8aaa0728a43936cd4c6e1ed590e01ba8f0fbf5b

我在哪里可以找到关于Gerrit更改号的更多讨论?它确实被弃用了吗?如果是,那么这是否意味着有一个不使用数字号码的工作流程? (但是如何构建Gerrit URL?)



我在这个页面上发现了这个讨论( Gerrit用户指南)。它表明了这个数字在工作流程中的重要性。


当一个提交被推入审查时,Gerrit将它存储在一个临时区域
这是特殊的refs / changes /命名空间中的一个分支。更改ref
的格式为refs / changes / XX / YYYY / ZZ,其中YYYY是数字
更改编号,ZZ是补丁集编号,XX是最后两个
位数数字改变号码,例如参考文献/更改/ 20 /一分之八十八万四千一百二十。
使用
Gerrit不需要了解这个ref的格式。



解决方案 div>

我期待着这样的讨论。我相信以下断言是真实的,但我需要确认。 (这就是为什么我一开始就在寻找文档的原因)。请帮助我。


  1. 与Gerrit Change-Id一样,Gerrit更改编号(又名数字更改编号)唯一标识 ,它可能有多个补丁集,这是在代码审查周期中经常需要的。与Gerrit Change-Id不同,它是一个小整数,可能更容易用于人类用户。 (相比之下,Gerrit Change-Id是一个长的哈希字符串,前面带有字符I)。
  2. Gerrit更改编号用于参考(参见开头提到的部分)以及URL和查询和REST API(请参阅ElpieKay的答案)

  3. Gerrit更改编号对于服务器是唯一的。在同一台服务器上托管的多个项目共享相同的编号空间。

  4. 一个Gerrit变更编号通常生成,单调增加, 到Gerrit服务器。但是,请注意,由于不同的更改可能需要不同的时间来完成代码审查,因此不能保证这些更改将按顺序应用于主分支(或根本无法应用)。作为这样的
    ,可以用更大的数字改变数字Y在主分支上生效,然后再使用更小的数字改变数字进行另一次更改X.换句话说,在主分支上,当分别有数字X和Y有两个变化,并且X 时,不能保证X 发生在 Y < STRONG>。


This is a follow-up question of my other question: What is the official name of the number in a Gerrit review url

I have now learned that the small integer embedded in a Gerrit url is called "Gerrit Change Number" and sometimes "Numeric Change Number". For example, it is the number 68 in the following Gerrit url

http://gerrithost:8080/68

This number plays an important role in understand the Gerrit workflow, yet there are not a lot of discussion about it. I even have a feeling that it may have been deprecated (because a Change-Id -- the long hash string prefixed with the character "I" -- also uniquely identify a gerrit Change)

Change-Id: Ic8aaa0728a43936cd4c6e1ed590e01ba8f0fbf5b

Where can I find more discussion about Gerrit Change Number? Is it indeed deprecated? If it is, then does that mean there is a workflow that does not use the numeric number? (But how would the Gerrit URL be constructed?)

I found this discussion on this page (Gerrit User Guide). It indicates the importance of the number in the workflow.

When a commit is pushed for review, Gerrit stores it in a staging area which is a branch in the special refs/changes/ namespace. A change ref has the format refs/changes/XX/YYYY/ZZ where YYYY is the numeric change number, ZZ is the patch set number and XX is the last two digits of the numeric change number, e.g. refs/changes/20/884120/1. Understanding the format of this ref is not required for working with Gerrit.

解决方案

I was expecting some discussion like this. I believe the following assertions are true, but I need confirmations. (That was why I was looking for documentation in the first place). Please help me.

  1. A Gerrit Change Number (aka Numeric Change Number), like Gerrit Change-Id, uniquely identifies a "change under review", which may have multiple patch sets as often are needed in a code-review cycle. Unlike Gerrit Change-Id, it is a small integer and perhaps more easy to use for human users. (In contrast, Gerrit Change-Id is a long hash string preceded with the character "I")
  2. A Gerrit Change Number is used in refs (see the section cited in the opening question) and in URLs and query and REST APIs (see the answer of ElpieKay)
  3. A Gerrit Change Number is unique to a server. Multiple projects hosted on the same server shares the same number space.
  4. A Gerrit Change Number is typically generated monotonically increasing as new changes are submitted for review to a Gerrit server. Note, however, that since different changes may take different time to finish code review, there is no guarantee that the changes will be applied to the master branch in order (or be applied at all). As such it is possible to have a change with a larger numeric change number Y to take effect on the master branch before another change with a smaller numeric change number X. In other words, on the master branch, when there are two changes with numbers X and Y respectively, and X<Y, there is NO guarantee that X happens-before Y.

这篇关于有关“Gerrit变更编号”的官方文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆