英文:
What does the Go Mod require mean
问题
关于https://stackoverflow.com/questions/53682247/how-to-point-go-module-dependency-in-go-mod-to-a-latest-commit-in-a-repo的问题
我在go.mod文件中有以下的require:
require (
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.18.1
k8s.io/api v0.24.2
k8s.io/apimachinery v0.24.2
k8s.io/client-go v0.24.2
sigs.k8s.io/controller-runtime v0.12.2
sigs.k8s.io/kubebuilder-declarative-pattern v0.11.20220513-0.20220602225619-fe5be9431eae // 为了status而添加(运行go mod tidy)
)
我无法理解最后一个。该仓库是https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern
它没有名为v0.11.20220513
的标签(https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/tags)
它有一个提交标签fe5be9431eae
有人知道如何访问v0.11.20220513-0.20220602225619-fe5be9431eae
所指向的提交,并且每个部分的含义是什么吗?
英文:
I have the following require in go.mod file
require (
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.18.1
k8s.io/api v0.24.2
k8s.io/apimachinery v0.24.2
k8s.io/client-go v0.24.2
sigs.k8s.io/controller-runtime v0.12.2
sigs.k8s.io/kubebuilder-declarative-pattern v0.11.20220513-0.20220602225619-fe5be9431eae // Added for status (run go mod tidy)
)
The last one I am not able to understand. The repo is https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern
It does NOT have a tag named v0.11.20220513
(https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/tags)
It has a commit tag fe5be9431eae
Anyone has an idea how to go to the commit referred to by v0.11.20220513-0.20220602225619-fe5be9431eae
and what does each part mean?
答案1
得分: 2
https://go.dev/ref/mod#pseudo-versions:
伪版本是一种特殊格式的预发布版本,它编码了有关版本控制存储库中特定修订的信息。例如,v0.0.0-20191109021931-daa7c04131f5
是一个伪版本。
因此,一旦你阅读了上面链接的完整的伪版本部分,你会发现版本v0.11.20220513-0.20220602225619-fe5be9431eae
由以下三个部分组成:
-
v0.11.20220513
:基础版本v0.11.20220512+1。> 当基础版本是类似于vX.Y.Z的发布版本时,使用
vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdefabcdef
。例如,如果基础版本是v1.2.3,伪版本可能是v1.2.4-0.20191109021931-daa7c04131f5。 -
0.20220602225619
:是时间戳0.yyyymmddhhmmss
。
> 时间戳(yyyymmddhhmmss),表示修订创建的UTC时间。在Git中,这是提交时间,而不是作者时间。 -
fe5be9431eae
:是提交哈希。
> 修订标识符(abcdefabcdef),是提交哈希的12个字符前缀,或者在Subversion中是零填充的修订号。
英文:
https://go.dev/ref/mod#pseudo-versions:
> A pseudo-version is a specially formatted pre-release version that
> encodes information about a specific revision in a version control
> repository. For example, v0.0.0-20191109021931-daa7c04131f5
is a
> pseudo-version.
So, once you read the full pseudo-versions section that's linked above, you'll find out that the version
v0.11.20220513-0.20220602225619-fe5be9431eae
is composed of the following three parts:
-
v0.11.20220513
: the base version v0.11.20220512+1.>
vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdefabcdef
is used when the base version
> is a release version like vX.Y.Z. For example, if the base version is
> v1.2.3, a pseudo-version might be
> v1.2.4-0.20191109021931-daa7c04131f5. -
0.20220602225619
: is the timestamp0.yyyymmddhhmmss
.
> A timestamp (yyyymmddhhmmss), which is the UTC time the revision was created. In Git, this is the commit time, not the author time. -
fe5be9431eae
: is the commit hash.
> A revision identifier (abcdefabcdef), which is a 12-character prefix of the commit hash, or in Subversion, a zero-padded revision number.
答案2
得分: 1
根据pseudo-version的解释,这里的第三部分是提交哈希的前12个字符。因此,你可以通过浏览<repo-path>/commit/<commit-prefix>
直接访问仓库上的提交。
在你的情况下,链接是https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/commit/fe5be9431eae
。
英文:
As pseudo-version explains, the third part of this is a 12-character prefix of the commit hash. so you can go to the commit on the repo directly by browsing <repo-path>/commit/<commit-prefix>
.
In your case, it is https://github.com/kubernetes-sigs/kubebuilder-declarative-pattern/commit/fe5be9431eae
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论