## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
• Jun 15 2020 13:06
arturcic unlabeled #2095
• Jun 15 2020 13:05
arturcic opened #2328
• Jun 15 2020 08:09
github-actions[bot] commented #2122
• Jun 15 2020 08:09
github-actions[bot] commented #2300
• Jun 15 2020 08:09
github-actions[bot] commented #2306
• Jun 15 2020 08:09
github-actions[bot] commented #2310
• Jun 15 2020 08:09
github-actions[bot] commented #2311
• Jun 15 2020 08:09
github-actions[bot] commented #2320
• Jun 15 2020 08:09
github-actions[bot] commented #2327
• Jun 15 2020 07:49
arturcic milestoned #2095
• Jun 15 2020 07:49
arturcic demilestoned #2095
• Jun 15 2020 07:46

arturcic on 5.3.6

• Jun 15 2020 07:27
arturcic demilestoned #2241
• Jun 15 2020 07:27
arturcic unassigned #2241
• Jun 15 2020 07:27
arturcic demilestoned #2074
• Jun 15 2020 07:26
arturcic milestoned #2327
• Jun 15 2020 07:25
arturcic demilestoned #2318
• Jun 15 2020 07:25
arturcic milestoned #2122
• Jun 15 2020 07:25
arturcic labeled #2122
• Jun 15 2020 07:23
arturcic demilestoned #2313
Sean Fausett
@gitfool
@arturcic if I understand correctly, the changes in GitTools/GitVersion#2221 means GitVersionTask will now robustly load its dependencies?
I moved away from the MSBuild tasks a while ago as it was plagued with loader context issues but would love to be able to move back to it!
Sean Fausett
@gitfool
More questions... despite what the docs say, https://gitversion.net/docs/usage/msbuild-task, I presume the MSBuild task works with dotnet build (dotnet core)?
... and is it possible to get the MSBuild task to write the new file output too (for tooling outside MSBuild to read)?
... and re https://github.com/GitTools/GitVersion/issues/2204#issuecomment-615881883, looks like you just missed the release of Ubuntu 20.04 (hint hint)
Sean Fausett
@gitfool
(... although Ubuntu 20.04 needs the next dotnet sdk which hasn't landed yet)
Lyubomyr Vyhovskyy
@luber
Hi guys. Does anyone know how to increment PreReleaseNumber?
I have release branch release/1.5.7, so GitVersion correctly determined semversion as 1.5.7-rc.1
Then I labeled last commit in this branch with v1.5.7-RC1 label and made few more commits. I expect to PreReleaseNumber will be increased so SemVersion would be v1.5.7-RC2, but it still v1.5.7-RC1
Roman Rozinov
@rroman81
@luber you need to make sure that the branch is in continuous deployment mode. The new default is that only develop is in that mode, other branches default to "continuous delivery" (requires a tag to increment).
Roman Rozinov
@rroman81
I have attempting to use bump message "+semver: feature" to increase the minor version during a PR merge, but it does not seem to take effect. Does it require to be in the body of the message itself or the lengthier description works as well?
Sven
@svengeance
@asbjornu Hey quick question about the upcoming 6.0.0 - is there any changes upcoming for arg parsing architecture?
Ranvir Singh
@ranvirsingh
Could not execute 'git log' due to the following error: System.IO.FileNotFoundException: The executable file 'git' could not be found. File name: 'git'
I am trying to run though teamcity VCS checkout "Always checkout file on Agent"
Ben Dean
@b-dean

Is there a way to make gitversion ignore commit messages and only use tags for versions?

I have a repo that uses gitflow but we have these non-semver "marketing" version numbers that are YYYY.N (year and number of releases that year). So we had some big effort on some release that had the release branch named something like release/2020.5-giant-project so there were merge messages with that into master and back into develop etc. The actual version is 2.0.0 and there's an annotated tag on master

but gitversion seems to ignore that tag and insists that the new version for develop should be some 2020.6.0 stuff, but it shouldn't, it should probably be 2.1.0

I'd like it to just use the git tags only not commits or merges for determining the base version
Ben Dean
@b-dean

I can put sha in the ignore list, but the problem is that some of those with the commit messages are also the ones that are tagged

$git log 2.0.0 commit a3079c986ec4df96eb50c2dcee5a575409e98084 Merge: 3bc4e9a 3ce74dd Author: Foo Bar <foo@bar.baz> Date: Thu May 14 23:10:59 2020 -0400 Merge branch 'release/2020.5-giant-project' so if I ignore that sha to avoid that merge commit message, it also ignores the tag vaishnav-n @vaishnav-n Hi, i am using gitversion 5.3.3 in cake. We get the build version details. Version goes till here [Version] INFO [05/20/20 9:24:59:42] Found 8 files [05:24:59][Version] INFO [05/20/20 9:24:59:61] Done writing but then version throws an error Checked the full log, no error messages as well vaishnav-n @vaishnav-n got an error message fiinally [Version] Exception isCake.Core.CakeException: GitVersion: Process returned an error (exit code 1). [08:11:36][Version] at Cake.Core.Tooling.Tool1.ProcessExitCode(Int32 exitCode) [08:11:36][Version] at Cake.Core.Tooling.Tool1.Run(TSettings settings, ProcessArgumentBuilder arguments, ProcessSettings processSettings, Action1 postAction) [08:11:36][Version] at Cake.Common.Tools.GitVersion.GitVersionRunner.Run(GitVersionSettings settings) [08:11:36][Version] at VersionAliases.Version(ICakeContext context) [08:11:36][Version] at Submission#0.Version() in :line 2763 [08:11:36][Version] at Submission#0.<<Initialize>>b0_3() in C:\BuildAgent\work\b6bc28d284e694e\build.cake:line 80 [08:11:36][Version] at Cake.Core.CakeTaskBuilderExtensions.<>c DisplayClass32_0.<Does>b0(ICakeContext x) [08:11:36][Version] at Cake.Core.CakeTask.<Execute>d 43.MoveNext() [08:11:36][Version] --- End of stack trace from previous location where exception was thrown --- [08:11:36][Version] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() [08:11:36][Version] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [08:11:36][Version] at Cake.Core.DefaultExecutionStrategy.<ExecuteAsync>d4.MoveNext() [08:11:36][Version] --- End of stack trace from previous location where exception was thrown --- [08:11:36][Version] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() [08:11:36][Version] at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) [08:11:36][Version] at Cake.Core.CakeEngine.<ExecuteTaskAsync>d 31.MoveNext() Chris Stylianou @chris5287 Hi, I've got a question around using GitVersion and NuGet packaging via dotnet pack. When GitVersion determines BuildMetaData should have a value, this in turn affects the FullSemVerto include it. Eg: Imaging current version is v1.2.4 and we are on a release branch with no tag yet, if GitVersion calculates BuildMetaData=4when I dotnet pack this will set FullSemVer=1.2.4-beta1+4. This becomes an issue for NuGet packages, as the .nuspec file's <version> property will use the FullSemVer (ie: 1.2.4-beta1+4) but the filename of the nupkg will be UsefulLib.1.2.4-beta1.nupkg as NuGet with normalise the filename and drop the metadata (https://github.com/NuGet/Home/wiki/SemVer-2.0.0-support#pack). However now if I do another follow-on build of the same commit thenBuildMetaData=5, FullSemVer=1.2.4-beta1+5 and .nuspec file's <version> property will use the FullSemVer (ie: 1.2.4-beta1+5) . BUT the nupkg filename will conflict with the previous UsefulLib.1.2.4-beta1.nupkg Has anyone dealt with this issue? Chris Stylianou @chris5287 FYI by setting “mode: ContinuousDeployment” this seems to generate Se mVer2 versions that work with NuGet packages. tomasz_augustyniak @tony6636 hi everyone, I'm trying to use GitVersion with Nuke Build within a DevOps Pipeline. Do I really need to install the UseGitVersion extension from Marketplace to be able to inject the variables in the code as [GitVersion] readonly GitVersion GitVersion; ? For now I'm getting the following error: > C:\Users\VssAdministrator\.nuget\packages\gitversion.commandline\5.3.4\tools\gitversion.exe ##[error]Process 'gitversion.exe' exited with code 1. Mattias Karlsson @devlead Does it work locally? Using same version of GitVersion? How are you calling GitVersion? With which args and in which folder as current directory? Inject variables in the code are you parsing the json or is this a Nuke issue? vaishnav-n @vaishnav-n Hi, when building a package , i am unable to remove the -ci tag from master builds. using gitversion 5.0.1 there is an issue related to this GitTools/GitVersion#999 but its been marked as stale Riksking @riksking Hi. I noticed one trouble in version 5.3.4. I have some c# projects on .net Core and .net Standard in one solution. And I have “Directory.Build.props” in core directory of solution with content <Project> <PropertyGroup> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> <UpdateAssemblyInfo>true</UpdateAssemblyInfo> <GenerateDocumentationFile>true</GenerateDocumentationFile> <NoWarn>$(NoWarn);1591</NoWarn> </PropertyGroup> </Project>

But when I build this project, I get this message
Target "UpdateAssemblyInfo" skipped, due to false condition; ($(UpdateAssemblyInfo) == 'true') was evaluated as (false == 'true'). And this Property reassignment:$(UpdateAssemblyInfo)="false" (previous value: "true") at \.nuget\packages\gitversiontask\5.3.4\build\GitVersionTask.props (22,9)
and the version is "0.0.0.0"

In version 5.0.1 it works fine and write current version of file.

Also, if I insert “<UpdateAssemblyInfo>true</UpdateAssemblyInfo>” into the project itself, version calculation and writing is successful.

vaishnav-n
@vaishnav-n
need help in moving a nuget package from prerelease to stable. building it using teamcity. we upload the package to a teamcity feed , feed only works with a prerelease version
Rodney Littles II
@RLittlesII
I have used GitVersion in the past for Xamarin Mobile. I have not tried it with the MSBuild task. I have a few questions around the support. The documentation states it will look for the AssemblyInfo.cs in the Properties directory. The command-line version does a recursive look. My AssemblyInfo.cs is currently at the root of the netstandard project. How can I verify that the MSBuild GitVersionTask is working correctly?
Simon Novak
@snovak7
I need some guidance with GitVersionTask with GitHub Actions, checkout seems to partially write some metadata (assuming) and I get error message from GitVersionTask stating: Please ensure that the repository is an unshallow clone with git fetch --unshallow.
Simon Novak
@snovak7
Ah found it :)
Rodney Littles II
@RLittlesII
Same. seems the GitVersionTask works fine on the netstandard project. Not just have to figure out to funnel that into the info.plist.
Sean Fausett
@gitfool
@snovak7 for GitHub Actions with actions/checkout@v2 you can now use fetch-depth: 0 to fetch all history needed by GitVersion
DocZoid
@DocZoid
I am encountering the following issue with GitVersion: I use GitFlow and have a release branch release/0.1.1. From that branch, GitVersion tells me to build a 0.1.1-rc.1 which is correct, so after building I tag the commit in the release branch with "0.1.1-rc.1". Now I want to build a release. I merge the release/0.1.1 branch onto master using fast-forward. When i now try to biuld from the master branch, GitVersion does not apply the master versioning (which would result in a version 0.1.1), but instead finds the tag "0.1.1-rc.1" and starts building a release candidate from the master branch. I understand that re-building the same version when a tag ist found is necessary, but that should only apply when the current branch yields the same preReleaseLabel ("rc" in this case). So, if my branch configuration tells me to build a "rc" version, and a tag exists with "-rc." preReleaseLabel, then use the tag. If I'm on master, and the branch configuration tells me to build a release without label, don't use any tags with preReleaseLabels.
TheKaliGuy
@TheKaliGuy
Hello community :)
I've just started to use GitVersion and Azure DevOps. I'm currently using task "- task: UseGitVersion@5" in my Pipeline. Without a configuration file specified or one created, after running the task, I notice it changes the Pipeline build number. I've had a small look through the documentation and searched online, unfortunately, I was unable to find a way to configure the GitVersion tool to not overwrite the build numbers.
Is there a way to do this? I'd appreciate if I could be pointed in the right direction and I apologise in advance for my ignorance.
Thank you :)
Kim J. Nordmo
@TheKaliGuy when you say it changes the Pipeline build number, to you mean the number displayed on the website (sorry if it is a stupid question, I am not really familiar with Azure).
But if that is the case, you can add the following arguments when calling gitversion to prevent that: -output json (by default I think gitversion runs with -output buildserver when running on azure).
TheKaliGuy
@TheKaliGuy
@AdmiringWorm Yes, that's right, the number displayed on the website :)
Specifying additionalArgumentswith the value of -output json doesn't seem to change it for me.
Was that on the documentation page? I'm asking because I've missed some things, it seems =D
jameswoodley
@jameswoodley
Hello. Just a quick check, what with the movement around language at the moment, and GitHub stating they will change master for an alternative (https://www.zdnet.com/article/github-to-replace-master-with-alternative-term-to-avoid-slavery-references/) will/does GitVersion have a setting to define the new mainline branch? If master doesn't exist, can we set it to work with main or trunk for example?
Gary Ewan Park
@gep13
@jameswoodley you can already define the branch names that you want to use with GitVersion in its yaml configuration file
Have a look here:
As an example.
That repository already has a main branch, rather than a master branch.
jameswoodley
@jameswoodley
Okay cool that's good to know thanks.
Tanner Watson
@tannerwatson
Question: Does GitVersion support monorepos where more than one versioned component is in the same repo? If it does I would assume there would need to be a separate config file per directory tree, with a different tagging pattern per individually versioned component
Gary Ewan Park
@gep13
@tannerwatson no, it doesn’t. It only generates a single version number per repo, based on git history.
Tanner Watson
@tannerwatson
@gep13 I sort of figured that but wanted to double check. Thank you much :)
Gary Ewan Park
@gep13
👍
Lazaro
@LazaroOnline
Hi, I was wondering as a developer of NuGet packages, how can GitVersion.Task tap into the msbuild execution without requiring anything else other than the NuGet being added to a project, can someone help me find how it is done?
Alexander Trauzzi
@atrauzzi
Hey everyone! Quick question... I'm configuring my builds and I noticed that every time I commit to master, it increments my major version, rather than patch.
Alexander Trauzzi
@atrauzzi
Is there any way to configure master` so that normal commit activity only increments patch?
2 replies