Gerrit 中的一个版本号反映了 master 分支上的总订单?
A release number in Gerrit that reflects the total order on the master branch?
这是对 () 的 follow-up 问题,其中陈述了以下断言:
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.
我们团队是从SVN迁移过来的,以前我们有一个单调递增的数字(release number)可以反映不同版本代码的总顺序。具体来说,我们可以告诉客户"Your software installation is at release X, but we fixed the bug only later in release Y (Y > X). So please update to a version of Y or later to get the bug fix."
根据上述断言,我们不能为此目的使用 Gerrit Change Number。所以这是我的问题:
能否Gerrit
生成一个release number可以反映master分支的总变更顺序?
进一步讨论
我了解 git
本身并不能保证提交集中 总顺序 。只有一个 部分顺序 -- 每个提交都有一个或多个 parents 因此是祖先,但是两个提交 J 和 K 既不能互为后代也不能互为祖先(即两者之间没有happens-before关系)。
然而,Gerrit
的情况有所不同。 Gerrit
是一个建立在 git
之上的系统,用于促进集中式工作流程。有一个单独的 master 分支,并且有一个 总订单 用于在 master 分支上集成(即合并或重新设置)的更改。如果在 master 分支上集成了两个不同的更改 A 和 B,那么 A 发生在 B 之前,或者 B 发生在 A 之前。因此实现一个根据主分支上发生的集成顺序生成序列号的功能并不难。而且这个数字会有很大的实际用处。
不,Gerrit 无法生成可以反映任何分支中更改的总顺序的版本号。
你在这里的方法是错误的...不要试图 "migrate" 你在 Subversion 中使用的 process/procedures 到 Git/Gerrit。 Git 是一个不同的工具,您也需要以不同的方式使用它。
您需要使用标签来标记版本。
有关详细信息,请参阅 Git - Tagging。
这是对
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.
我们团队是从SVN迁移过来的,以前我们有一个单调递增的数字(release number)可以反映不同版本代码的总顺序。具体来说,我们可以告诉客户"Your software installation is at release X, but we fixed the bug only later in release Y (Y > X). So please update to a version of Y or later to get the bug fix."
根据上述断言,我们不能为此目的使用 Gerrit Change Number。所以这是我的问题:
能否Gerrit
生成一个release number可以反映master分支的总变更顺序?
进一步讨论
我了解 git
本身并不能保证提交集中 总顺序 。只有一个 部分顺序 -- 每个提交都有一个或多个 parents 因此是祖先,但是两个提交 J 和 K 既不能互为后代也不能互为祖先(即两者之间没有happens-before关系)。
然而,Gerrit
的情况有所不同。 Gerrit
是一个建立在 git
之上的系统,用于促进集中式工作流程。有一个单独的 master 分支,并且有一个 总订单 用于在 master 分支上集成(即合并或重新设置)的更改。如果在 master 分支上集成了两个不同的更改 A 和 B,那么 A 发生在 B 之前,或者 B 发生在 A 之前。因此实现一个根据主分支上发生的集成顺序生成序列号的功能并不难。而且这个数字会有很大的实际用处。
不,Gerrit 无法生成可以反映任何分支中更改的总顺序的版本号。
你在这里的方法是错误的...不要试图 "migrate" 你在 Subversion 中使用的 process/procedures 到 Git/Gerrit。 Git 是一个不同的工具,您也需要以不同的方式使用它。
您需要使用标签来标记版本。
有关详细信息,请参阅 Git - Tagging。