GitVersion發出斷言版本號的很多不同部分,每個部分都可以用來形成所需的版本號,但是,縮短的sha不是其中之一。這裏是所有當前斷言的變量:
{
"Major":0,
"Minor":21,
"Patch":0,
"PreReleaseTag":"",
"PreReleaseTagWithDash":"",
"PreReleaseLabel":"",
"PreReleaseNumber":"",
"BuildMetaData":"",
"BuildMetaDataPadded":"",
"FullBuildMetaData":"Branch.hotfix/0.21.1.Sha.57e16a787815c5e27c3a0edbf5224b3df64f1a69",
"MajorMinorPatch":"0.21.0",
"SemVer":"0.21.0",
"LegacySemVer":"0.21.0",
"LegacySemVerPadded":"0.21.0",
"AssemblySemVer":"0.21.0.0",
"FullSemVer":"0.21.0",
"InformationalVersion":"0.21.0+Branch.hotfix/0.21.1.Sha.57e16a787815c5e27c3a0edbf5224b3df64f1a69",
"BranchName":"hotfix/0.21.1",
"Sha":"57e16a787815c5e27c3a0edbf5224b3df64f1a69",
"NuGetVersionV2":"0.21.0",
"NuGetVersion":"0.21.0",
"CommitsSinceVersionSource":0,
"CommitsSinceVersionSourcePadded":"0000",
"CommitDate":"2017-07-14"
}
假設你正在使用某種形式的構建腳本,你可以手工縮短斷言沙,再與其它所需的變量結合起來,以獲得所需的版本號。
我記得,我不這麼認爲。我看了看,但從未發現它。 – Philippe