0

这很简单:我正在尝试使用 gitversion 来管理 semver,并且我在 windows 和 mac 之间的同一个 repo/branch/commit 上得到了完全不同的行为。我希望有人可以解释,因为没有它我无法管理版本碰撞。

苹果电脑:

cbongiorno at 5cg4461z2l in ~/dev/adaptors on master [$]
$  git log -1 --pretty=oneline
e7592b7703792069e4f1a69317ef50fa1deae2eb (HEAD -> master, origin/master) PE20-165 - fix the command, again!

cbongiorno at 5cg4461z2l in ~/dev/adaptors on master [$]
$ gitversion /version
5.1.3+Branch.master.Sha.bef8ebc0b62b3ddd0cdafe09b66d68bbfcaf90d5

cbongiorno at 5cg4461z2l in ~/dev/adaptors on master [$]
$ git rev-parse --abbrev-ref HEAD
master

cbongiorno at 5cg4461z2l in ~/dev/adaptors on master [$]
$ gitversion
{
  "Major":0,
  "Minor":2,
  "Patch":1,
  "PreReleaseTag":"",
  "PreReleaseTagWithDash":"",
  "PreReleaseLabel":"",
  "PreReleaseNumber":"",
  "WeightedPreReleaseNumber":"",
  "BuildMetaData":19,
  "BuildMetaDataPadded":"0019",
  "FullBuildMetaData":"19.Branch.master.Sha.e7592b7703792069e4f1a69317ef50fa1deae2eb",
  "MajorMinorPatch":"0.2.1",
  "SemVer":"0.2.1",
  "LegacySemVer":"0.2.1",
  "LegacySemVerPadded":"0.2.1",
  "AssemblySemVer":"0.2.1.0",
  "AssemblySemFileVer":"0.2.1.0",
  "FullSemVer":"0.2.1+19",
  "InformationalVersion":"0.2.1+19.Branch.master.Sha.e7592b7703792069e4f1a69317ef50fa1deae2eb",
  "BranchName":"master",
  "Sha":"e7592b7703792069e4f1a69317ef50fa1deae2eb",
  "ShortSha":"e7592b7",
  "NuGetVersionV2":"0.2.1",
  "NuGetVersion":"0.2.1",
  "NuGetPreReleaseTagV2":"",
  "NuGetPreReleaseTag":"",
  "VersionSourceSha":"800649c8102414d2513a19253ff2a4caadafb2ab",
  "CommitsSinceVersionSource":19,
  "CommitsSinceVersionSourcePadded":"0019",
  "CommitDate":"2020-02-20"
}


视窗:

PS C:\Users\cbongiorno> cd E:\SysData\Jenkins\workspace\chb0_chb0mb_master
PS E:\SysData\Jenkins\workspace\chb0_chb0mb_master> git log -1 --pretty=oneline
e7592b7703792069e4f1a69317ef50fa1deae2eb (HEAD -> master, tag: 0.1.0, origin/master) PE20-165 - fix the command, again!
PS E:\SysData\Jenkins\workspace\chb0_chb0mb_master> gitversion /version
5.1.3+Branch.master.Sha.bef8ebc0b62b3ddd0cdafe09b66d68bbfcaf90d5
PS E:\SysData\Jenkins\workspace\chb0_chb0mb_master> gitversion
{
  "Major":0,
  "Minor":1,
  "Patch":0,
  "PreReleaseTag":"",
  "PreReleaseTagWithDash":"",
  "PreReleaseLabel":"",
  "PreReleaseNumber":"",
  "WeightedPreReleaseNumber":"",
  "BuildMetaData":"",
  "BuildMetaDataPadded":"",
  "FullBuildMetaData":"Branch.master.Sha.e7592b7703792069e4f1a69317ef50fa1deae2eb",
  "MajorMinorPatch":"0.1.0",
  "SemVer":"0.1.0",
  "LegacySemVer":"0.1.0",
  "LegacySemVerPadded":"0.1.0",
  "AssemblySemVer":"0.1.0.0",
  "AssemblySemFileVer":"0.1.0.0",
  "FullSemVer":"0.1.0",
  "InformationalVersion":"0.1.0+Branch.master.Sha.e7592b7703792069e4f1a69317ef50fa1deae2eb",
  "BranchName":"master",
  "Sha":"e7592b7703792069e4f1a69317ef50fa1deae2eb",
  "ShortSha":"e7592b7",
  "NuGetVersionV2":"0.1.0",
  "NuGetVersion":"0.1.0",
  "NuGetPreReleaseTagV2":"",
  "NuGetPreReleaseTag":"",
  "VersionSourceSha":"e7592b7703792069e4f1a69317ef50fa1deae2eb",
  "CommitsSinceVersionSource":92,
  "CommitsSinceVersionSourcePadded":"0092",
  "CommitDate":"2020-02-20"
}
PS E:\SysData\Jenkins\workspace\chb0_chb0mb_master> git rev-parse --abbrev-ref HEAD
master

即使我正在处理相同的回购/提交,版本号也完全不同。这必须是一个错误。

谁能解释一下?

4

0 回答 0