Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ Versioning when using git, solved. GitVersion looks at your git history and work
|NuGet (GitVersion.CommandLine)|[![NuGet](https://img.shields.io/nuget/v/GitVersion.CommandLine.svg)](https://www.nuget.org/packages/GitVersion.CommandLine)|[![NuGet](https://img.shields.io/nuget/vpre/GitVersion.CommandLine.svg)](https://www.nuget.org/packages/GitVersion.CommandLine)|
|Gem|[![Gem](https://img.shields.io/gem/v/gitversion.svg)](https://rubygems.org/gems/gitversion)|[![Gem](https://img.shields.io/gem/v/gitversion.svg)](https://rubygems.org/gems/gitversion)|

## Compatibility
GitVersion works on Mac, Linux with Mono and Windows.

Tip: If you get `System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: lib/linux/x86_64/libgit2-baa87df.so`

You likely need to install `libcurl3`. Run `sudo get-get install libcurl3`

## Quick Links
- [Documentation](http://gitversion.readthedocs.org/en/latest)
- [Contributing](https://github.com/GitTools/GitVersion/blob/master/CONTRIBUTING.md)
Expand Down
7 changes: 7 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ GitVersion is a tool to help you achieve *Semantic Versioning* on your project.

This influences many of the decisions GitVersion has made, please read and understand this page as it will help you start using GitVersion effectively!

## Compatibility
GitVersion works on Mac, Linux with Mono and Windows.

Tip: If you get `System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: lib/linux/x86_64/libgit2-baa87df.so`

You likely need to install `libcurl3`. Run `sudo get-get install libcurl3`

## Assumptions/Rules
### Tags override other rules
If a commit is tagged, then GitVersion will *always* use that version over any calculated versions. This is so if you rebuild a tag then the same version will be produced.
Expand Down
5 changes: 4 additions & 1 deletion docs/usage/command-line.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,7 @@ At the moment only `tag-prefix` option is supported. Read more about [Configurat
It will not change config file 'GitVersion.yml'.

### Example: How to override configuration option 'tag-prefix' to use prefix 'custom'
`GitVersion.exe /output json /overrideconfig tag-prefix=custom`
`GitVersion.exe /output json /overrideconfig tag-prefix=custom`

## Mono
To use on mac or linux, install `mono-complete` then just run `mono GitVersion.exe`
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using GitVersionCore.Tests;
using NUnit.Framework;
using Shouldly;
using System.Reflection;

[TestFixture]
public class GitLabCiMessageGenerationTests
Expand All @@ -29,8 +30,8 @@ public void GenerateMessageTest()
[Test]
public void WriteAllVariablesToTheTextWriter()
{
// this test method writes to disc, hence marked explicit
var f = "this_file_should_be_deleted.properties";
var assemblyLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var f = Path.Combine(assemblyLocation, "this_file_should_be_deleted.properties");

try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using GitVersionCore.Tests;
using NUnit.Framework;
using Shouldly;
using System.Reflection;

[TestFixture]
public class JenkinsMessageGenerationTests
Expand All @@ -29,8 +30,8 @@ public void GenerateMessageTest()
[Test]
public void WriteAllVariablesToTheTextWriter()
{
// this test method writes to disc, hence marked explicit
var f = "this_file_should_be_deleted.properties";
var assemblyLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var f = Path.Combine(assemblyLocation, "this_file_should_be_deleted.properties");

try
{
Expand Down
4 changes: 2 additions & 2 deletions src/GitVersionCore.Tests/GitVersionContextTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ public void CanFindParentBranchForInheritingIncrementStrategy()
using (var repo = new EmptyRepositoryFixture())
{
repo.Repository.MakeACommit();
repo.Repository.Checkout(repo.Repository.CreateBranch("develop"));
Commands.Checkout(repo.Repository, repo.Repository.CreateBranch("develop"));
repo.Repository.MakeACommit();
var featureBranch = repo.Repository.CreateBranch("feature/foo");
repo.Repository.Checkout(featureBranch);
Commands.Checkout(repo.Repository, featureBranch);
repo.Repository.MakeACommit();

var context = new GitVersionContext(repo.Repository, config);
Expand Down
10 changes: 5 additions & 5 deletions src/GitVersionCore.Tests/GitVersionCore.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.137\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.137\build\LibGit2Sharp.NativeBinaries.props')" />
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.160\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.160\build\LibGit2Sharp.NativeBinaries.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -42,16 +42,16 @@
<HintPath>..\packages\FluentDateTime.1.13.0\lib\NET35\FluentDateTime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="GitTools.Core, Version=1.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\GitTools.Core.1.2.0\lib\net45\GitTools.Core.dll</HintPath>
<Reference Include="GitTools.Core, Version=1.2.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\GitTools.Core.1.2.1-beta0001\lib\net45\GitTools.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="GitTools.Testing, Version=1.1.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\GitTools.Testing.1.1.1-beta0001\lib\net4\GitTools.Testing.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="LibGit2Sharp, Version=0.23.0.0, Culture=neutral, PublicKeyToken=7cbde695407f0333, processorArchitecture=MSIL">
<HintPath>..\packages\LibGit2Sharp.0.23.0-pre20150419160303\lib\net40\LibGit2Sharp.dll</HintPath>
<HintPath>..\packages\LibGit2Sharp.0.23.0-pre20160922233542\lib\net40\LibGit2Sharp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
Expand Down Expand Up @@ -212,7 +212,7 @@
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Fody.1.29.4\build\dotnet\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.29.4\build\dotnet\Fody.targets'))" />
<Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.137\build\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.1.0.137\build\LibGit2Sharp.NativeBinaries.props'))" />
<Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.160\build\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.1.0.160\build\LibGit2Sharp.NativeBinaries.props'))" />
</Target>
<Import Project="..\packages\Fody.1.29.4\build\dotnet\Fody.targets" Condition="Exists('..\packages\Fody.1.29.4\build\dotnet\Fody.targets')" />
</Project>
26 changes: 13 additions & 13 deletions src/GitVersionCore.Tests/IntegrationTests/DevelopScenarios.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public void WhenDevelopHasMultipleCommits_SpecifyExistingCommitId()
using (var fixture = new EmptyRepositoryFixture())
{
fixture.Repository.MakeATaggedCommit("1.0.0");
fixture.Repository.Checkout(fixture.Repository.CreateBranch("develop"));
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));

fixture.Repository.MakeACommit();
fixture.Repository.MakeACommit();
Expand All @@ -31,7 +31,7 @@ public void WhenDevelopHasMultipleCommits_SpecifyNonExistingCommitId()
using (var fixture = new EmptyRepositoryFixture())
{
fixture.Repository.MakeATaggedCommit("1.0.0");
fixture.Repository.Checkout(fixture.Repository.CreateBranch("develop"));
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));

fixture.Repository.MakeACommit();
fixture.Repository.MakeACommit();
Expand All @@ -49,7 +49,7 @@ public void WhenDevelopBranchedFromTaggedCommitOnMasterVersionDoesNotChange()
using (var fixture = new EmptyRepositoryFixture())
{
fixture.Repository.MakeATaggedCommit("1.0.0");
fixture.Repository.Checkout(fixture.Repository.CreateBranch("develop"));
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
fixture.AssertFullSemver("1.0.0");
}
}
Expand All @@ -72,7 +72,7 @@ public void CanChangeDevelopTagViaConfig()
using (var fixture = new EmptyRepositoryFixture())
{
fixture.Repository.MakeATaggedCommit("1.0.0");
fixture.Repository.Checkout(fixture.Repository.CreateBranch("develop"));
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
fixture.Repository.MakeACommit();
fixture.AssertFullSemver(config, "1.1.0-alpha.1");
}
Expand All @@ -84,7 +84,7 @@ public void WhenDeveloperBranchExistsDontTreatAsDevelop()
using (var fixture = new EmptyRepositoryFixture())
{
fixture.Repository.MakeATaggedCommit("1.0.0");
fixture.Repository.Checkout(fixture.Repository.CreateBranch("developer"));
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("developer"));
fixture.Repository.MakeACommit();
fixture.AssertFullSemver("1.0.1-developer.1+1"); // this tag should be the branch name by default, not unstable
}
Expand All @@ -96,7 +96,7 @@ public void WhenDevelopBranchedFromMaster_MinorIsIncreased()
using (var fixture = new EmptyRepositoryFixture())
{
fixture.Repository.MakeATaggedCommit("1.0.0");
fixture.Repository.Checkout(fixture.Repository.CreateBranch("develop"));
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
fixture.Repository.MakeACommit();
fixture.AssertFullSemver("1.1.0-alpha.1");
}
Expand All @@ -108,14 +108,14 @@ public void MergingReleaseBranchBackIntoDevelopWithMergingToMaster_DoesBumpDevel
using (var fixture = new EmptyRepositoryFixture())
{
fixture.Repository.MakeATaggedCommit("1.0.0");
fixture.Repository.Checkout(fixture.Repository.CreateBranch("develop"));
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
fixture.Repository.MakeACommit();
fixture.Repository.Checkout(fixture.Repository.CreateBranch("release-2.0.0"));
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("release-2.0.0"));
fixture.Repository.MakeACommit();
fixture.Repository.Checkout("master");
Commands.Checkout(fixture.Repository, "master");
fixture.Repository.MergeNoFF("release-2.0.0", Generate.SignatureNow());

fixture.Repository.Checkout("develop");
Commands.Checkout(fixture.Repository, "develop");
fixture.Repository.MergeNoFF("release-2.0.0", Generate.SignatureNow());
fixture.AssertFullSemver("2.1.0-alpha.2");
}
Expand All @@ -138,7 +138,7 @@ public void CanHandleContinuousDelivery()
using (var fixture = new EmptyRepositoryFixture())
{
fixture.Repository.MakeATaggedCommit("1.0.0");
fixture.Repository.Checkout(fixture.Repository.CreateBranch("develop"));
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
fixture.Repository.MakeATaggedCommit("1.1.0-alpha7");
fixture.AssertFullSemver(config, "1.1.0-alpha.7");
}
Expand All @@ -150,11 +150,11 @@ public void WhenDevelopBranchedFromMasterDetachedHead_MinorIsIncreased()
using (var fixture = new EmptyRepositoryFixture())
{
fixture.Repository.MakeATaggedCommit("1.0.0");
fixture.Repository.Checkout(fixture.Repository.CreateBranch("develop"));
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
fixture.Repository.MakeACommit();
var commit = fixture.Repository.Head.Tip;
fixture.Repository.MakeACommit();
fixture.Repository.Checkout(commit);
Commands.Checkout(fixture.Repository, commit);
fixture.AssertFullSemver("1.1.0-alpha.1");
}
}
Expand Down
Loading