Main is always 0.5.* for some reason? #4836
-
|
I'm running into some strange behavior with the TrunkBased/preview1 preset config, and I'd appreciate if anyone can help me figure out what to do about it. Before ExperimentingOn main, I had an initial commit, 3 pairs of squash and merge commits with semver minors, and a pair of squash and merge commits with semver patch. Gitversion was telling me that the version was 0.5.1. Before I realized that the squashes and merges were associated with each other, I was expecting it to be 0.6.2, and after I realized and figured something in the config was , I expected 0.3.1. When I created a branch, it initially had version 0.5.2-testBranch.0, which jumped to 0.3.2-testBranch1 once I made a commit on the branch. I then tried doing a dummy branch and merge request back to main with a semver:minor and sure enough, it says it's version 0.5.0 again. It seems like it's not calculating the version on main properly, but once I get into a branch it is. Does anyone know what I can try to fix this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
In the TrunkBased/preview1.yml template the increment on main branch is set to patch. This would explain why only the third number changes. Cheers! |
Beta Was this translation helpful? Give feedback.
$ mkdir A-TrunkBased-Repo
$ cd A-TrunkBased-Repo/
$ git init .
$ echo workflow: TrunkBased/preview1 > GitVersion.yml
$ git add *
$ git commit -m "init"
$ git switch -c unkown-branch
$ git commit --allow-empty -m "A"
$ git switch main
$ git merge unkown-branch --no-ff (+semver:minor added in vim)
$ git log