Use convention to derive a SemVer product version from a GitFlow based repository
arturcic on 5.3.6
@PatrickBig you should had the following to your YAML:
variables:
GitVersion.SemVer: ''
GitVersion.AssemblySemVer: ''
GitVersion.MajorMinorPatch: ''
GitVersion.InformationalVersion: ''
steps:
task: gitversion/setup@0
inputs:
versionSpec: '5.x'
displayName: 'GitVersion setup'
task: gitversion/execute@0
displayName: 'GitVersion execute'
task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
command: 'build'
projects: '$(project)'
arguments: '/p:Version=$(GitVersion.SemVer)
/p:AssemblyVersion=$(GitVersion.AssemblySemVer)
/p:FileVersion=$(GitVersion.MajorMinorPatch)
/p:InformationalVersion=$(GitVersion.InformationalVersion)
--configuration $(buildConfiguration)'
mode: ContinuousDelivery
continuous-delivery-fallback-tag: ''
branches: {}
ignore:
sha: []
merge-message-formats: {}
0.1.0
on master. Created hotfixes/0.1.1
from master
.
hotfixes/0.1.1
, which GitVersion asserted as 0.1.1-beta.1+71. Perfect.
0.1.1-beta.1
(I'm following the GitFlow example here https://gitversion.net/docs/git-branching-strategies/gitflow-examples#hotfix-branches)
refs/heads/pull/943/merge
is not going to be providing GitVersion with an accurate history to work off of.
id
of the step to gitversion
Hey all, I'm trying to get GitVersion to install on my build server (linux) but having some trouble. Most likely due to my proxy setup at the company I work at.
If I use the GitTools/setup task I get a timeout. Anything else that needs to reach the internet doesn't seem to have any problems. Any advise?
Another route I was trying to do was to just pre-install on the agent. But using
dotnet tool install -g GitVersion.Tool
Didn't seem to help
Hi all :-) I have a small problem with the configuration from the documentation: https://gitversion.readthedocs.io/en/latest/input/docs/configuration/
There, in the chapter assembly-file-versioning-format the following is given as an example:
assembly-file-versioning-format: '{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber ?? 0}'
If I use this configuration with the Mainline Mode in our Azure DevOps with the BuildTask GitVersion the following error message appears:
Unable to format AssemblyFileVersioningFormat. Check your format string: 'WeightedPreReleaseNumber ?? 0' is not a member of type 'GitVersion.SemanticVersionFormatValues'
Does anyone have an idea?
I thank you in advance and look forward to your answers. Greetings Pete
assembly-file-versioning-format: '{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber ?? 0}'
should work. Here's a relevant test: https://github.com/GitTools/GitVersion/blob/f6bc10b11f2ae5218bbeb3fc448b9510fa721aa9/src/GitVersionCore.Tests/Extensions/StringFormatWithExtensionTests.cs#L219-L226
{Major}.{Minor}.{Patch}.{WeightedPreReleaseNumber ?? 0}
, which we of course should do. If you can create a PR with that test, that would be great. If not, perhaps I can look into it tonight.
I think i found the Problem:
Task : GitVersion Task
Description : Easy Semantic Versioning (http://semver.org) for projects using Git
Version : 5.0.1
Author : GitVersion Contributors
Is there a way to really force a specific version on a specific branch? next-version set the base version, but then a calculation still occurs on it.
My problem is that I need to create an old version of a package to support old stuff, and to avoid having this old stuff sitting on a new version, I was looking for a way to force gitversion to get a tag v0.x.x even if there is already a tag v2.0.0 in place, but if I do that gitversion still calculates from v2.0.0
I've also tried with the ignore but seems the configuration is not read properly the showconfig still return ignore: sha: [] even if I set the commits-before properly
This in fact will become a sort of support branch, that will remain there as far as I will need that old version.
Hello Everyone, Is somebody have this error on gitversion 5.3.7INFO [09/14/20 10:15:02:24] Begin: Normalizing git directory for branch 'refs/pull/2071/head'
[09:15:03][Step 3/3] INFO [09/14/20 10:15:02:28] One remote found (origin -> 'git@github.com:betclicgroup/database-sql-instances.git').
[09:15:03][Step 3/3] INFO [09/14/20 10:15:02:28] Skipping fetching, if GitVersion does not calculate your version as expected you might need to allow fetching or use dynamic repositories
[09:15:03][Step 3/3] INFO [09/14/20 10:15:02:29] Creating local branch refs/heads/pull/2071/head pointing at 080e678a3e4364b3517a1efbac0554fd4749f51f
[09:15:03][Step 3/3] INFO [09/14/20 10:15:02:43] End: Normalizing git directory for branch 'refs/pull/2071/head' (Took: 195.02ms)
[09:15:03][Step 3/3] ERROR [09/14/20 10:15:02:86] An unexpected error occurred:
[09:15:03][Step 3/3] System.NullReferenceException: Object reference not set to an instance of an object.
[09:15:03][Step 3/3] at GitVersion.Extensions.RepositoryExtensions.CreateOrUpdateLocalBranchesFromRemoteTrackingOnes(IRepository repo, ILog log, String remoteName) in D:\a\GitVersion\GitVersion\src\GitVersionCore\Extensions\RepositoryExtensions.cs:line 177
[09:15:03][Step 3/3] at GitVersion.GitPreparer.NormalizeGitDirectory(String gitDirectory, Boolean noFetch, String currentBranch, Boolean isDynamicRepository) in D:\a\GitVersion\GitVersion\src\GitVersionCore\Core\GitPreparer.cs:line 227
[09:15:03][Step 3/3] at GitVersion.GitPreparer.NormalizeGitDirectory(String targetBranch, String gitDirectory, Boolean isDynamicRepository) in D:\a\GitVersion\GitVersion\src\GitVersionCore\Core\GitPreparer.cs:line 141
[09:15:03][Step 3/3] at GitVersion.GitVersionTool.CalculateVersionVariables() in D:\a\GitVersion\GitVersion\src\GitVersionCore\Core\GitVersionTool.cs:line 59
[09:15:03][Step 3/3] at GitVersion.GitVersionExecutor.RunGitVersionTool(GitVersionOptions gitVersionOptions) in D:\a\GitVersion\GitVersion\src\GitVersionExe\GitVersionExecutor.cs:line 56
[09:15:03][Step 3/3] INFO [09/14/20 10:15:02:86] Attempting to show the current git graph (please include in issue):
[09:15:03][Step 3/3] INFO [09/14/20 10:15:02:86] Showing max of 100 commits
[09:15:03][Step 3/3] INFO [09/14/20 10:15:03:12] * 080e678a 25 minutes ago (HEAD -> pull/2071/head, origin/feature/622, refs/pull/2071/head, feature/622)
Running locally on developer computer no problem.
Running locally on serveur no problem.
Launching by Teamcity => failure.
The problem is very ramdom. Will work sometimes other times no.
For the moment , i found no way to repoduce it locally and debug gitversion.
I see some "similar issue " GitTools/GitVersion#912 , but i see that they are all closed.
Please help us to find a way to solve this problem or at least how to reproduce it locally .
Thanks in advance
Best regards