Nuget 自定义版本后缀MinVer
我正在使用MinVer,无法找到如何获取提交高度来创建自定义版本后缀。理想情况下,我希望使用1.0.0-preview.{commits}而不是1.0.0.-preview.0.{commits}。我不知道预发布标签和提交高度之间的零是多少。(是的,我已将Nuget 自定义版本后缀MinVer,nuget,version,minver,Nuget,Version,Minver,我正在使用MinVer,无法找到如何获取提交高度来创建自定义版本后缀。理想情况下,我希望使用1.0.0-preview.{commits}而不是1.0.0.-preview.0.{commits}。我不知道预发布标签和提交高度之间的零是多少。(是的,我已将设置为预览:)) 其次,使用我注意到提交的数量存在差异。下面是一些我正在进行实验的结果 诊断MinVer给了我一些关于根提交的提示,但我对git知之甚少,git决定根提交的是什么 MinVer: Starting at commit a54e9
设置为预览:))
其次,使用我注意到提交的数量存在差异。下面是一些我正在进行实验的结果
诊断MinVer给了我一些关于根提交的提示,但我对git知之甚少,git决定根提交的是什么
MinVer: Starting at commit a54e9e9 (height 0)...
MinVer: History diverges from 3c0633f (height 20) to:
MinVer: - 56af0a5 (height 21)
MinVer: - 747ef5a (height 21)
MinVer: Following path from 3c0633f (height 20) through first parent 56af0a5 (height 21)...
MinVer: Found root commit { Commit: faa505b, Tag: null, Version: 0.0.0-preview.0, Height: 34 }.
MinVer: Backtracking to 3c0633f (height 20) and following path through last parent 747ef5a (height 21)...
MinVer: History converges from 0f35453 (height 24) back to previously seen commit 8dc52dc (height 25). Abandoning path.
MinVer: 39 commits checked.
MinVer: No commit found with a valid SemVer 2.0 version prefixed with ''. Using default version 0.0.0-preview.0.
MinVer: Using { Commit: faa505b, Tag: null, Version: 0.0.0-preview.0, Height: 34 }.
因此,总结一下:
minver
,但由于声誉不高而无法添加:)
谢谢
约金
MinVerDefaultPreReleasePhase
执行该阶段
0.0.0-preview.0.34
。当您想要发布第一个预览时,您需要使用1.0.0-preview.1标记提交,MinVer会将该版本嵌入到您的程序集和包中
如何计算/确定提交高度
下文对此进行了解释:
您会注意到,当当前提交未标记时,MinVer会在预发布标识符中添加另一个数字。这是自最新标记之后的提交数,如果未找到标记,则是自根提交之后的提交数。这被称为“高度”。例如,如果找到的最新标记为1.0.0-beta.1
,高度为42次提交,则计算的版本为1.0.0-beta.1.42
从以下方面:
如果在找到最新的标记(或根提交)之前,历史发散,然后再次聚合,该怎么办
MinVer将使用历史发散处遵循的第一条路径上的高度。路径的顺序与提交的父级存储在git中的顺序相同。第一个父级是执行合并时作为当前分支的分支上的提交。其余的父级按其分支在merge命令中指定的顺序存储
你还可以看到极其详细的情况:
我可以获取日志输出以查看MinVer如何计算版本吗
对!!MinVerVerbosity可以设置为安静、最小(默认)、正常、详细或诊断
在诊断级别,您将看到MinVer如何以令人痛苦的细节处理提交历史
@乔卡尔,你自己没必要这么做Microsoft.SourceLink.GitHub
为您完成这项工作。例如,在Bullseye中,我只是将提交ID嵌入其中。例如,[assembly:AssemblyInformationalVersion(“3.2.0+01c985c5c48e76c819e7096692dbf4a5b0736d4c”)
。您认为仅使用SourceLink soley有任何直接的缺点吗?不使用SourceLink的原因是,我正在为我们的内部应用程序开发基础设施,不需要任何调试符号或snupkg文件。谢谢,我真的看不出有什么缺点。毕竟,SourceLink不会创建任何额外的包/程序集工件,它只是增强了PDB。
MinVer: Starting at commit a54e9e9 (height 0)...
MinVer: History diverges from 3c0633f (height 20) to:
MinVer: - 56af0a5 (height 21)
MinVer: - 747ef5a (height 21)
MinVer: Following path from 3c0633f (height 20) through first parent 56af0a5 (height 21)...
MinVer: Found root commit { Commit: faa505b, Tag: null, Version: 0.0.0-preview.0, Height: 34 }.
MinVer: Backtracking to 3c0633f (height 20) and following path through last parent 747ef5a (height 21)...
MinVer: History converges from 0f35453 (height 24) back to previously seen commit 8dc52dc (height 25). Abandoning path.
MinVer: 39 commits checked.
MinVer: No commit found with a valid SemVer 2.0 version prefixed with ''. Using default version 0.0.0-preview.0.
MinVer: Using { Commit: faa505b, Tag: null, Version: 0.0.0-preview.0, Height: 34 }.