Skip to content

Commit d796782

Browse files
committed
Merge remote-tracking branch 'upstream/master' into release/3.0.0
2 parents 2394a10 + 76b0bc2 commit d796782

17 files changed

+76
-25
lines changed

Docs/configurationOptions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# Confiuration options
1+
# Configuration options

Docs/index.md renamed to Docs/readme.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ GitVersion is a tool to help you achieve Semantic Versioning on your project.
44
This influences many of the decisions GitVersion has made, please read and understand this page as it will help you start using GitVersion effectively!
55

66
## Assumptions/Rules
7-
### You tag releases when you release, not before
8-
GitVersion assumes that tags are used to *tag a release* and not used to build a release.
9-
10-
This means that the version is calculated pre-emptively, if you currently tag, build then release that tag then GitVersion will probably not work for you.
11-
127
### Tags override other rules
138
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.
149

@@ -39,6 +34,6 @@ We recognise that a single formatted version number does not work for all cases.
3934
You can just run `GitVersion.exe` in your repository to see what variables are available (by default a json object is returned).
4035

4136
## Exe or MSBuild Task
42-
There are two ways to consume GitVersion, the first is by running GitVersion.exe. The second is an MSBUild task. The MSBuild task is really easy to get up and running, simply install GitVersionTask from NuGet and it will integrate into your project and write out variables to your build server if it's running on one. The exe offers more options and works for not just .net projects.
37+
There are two ways to consume GitVersion, the first is by running GitVersion.exe. The second is an MSBuild task. The MSBuild task is really easy to get up and running, simply install GitVersionTask from NuGet and it will integrate into your project and write out variables to your build server if it's running on one. The exe offers more options and works for not just .net projects.
4338

4439
Read more about [using GitVersion](./usage.md)

Docs/versionSources.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ GitVersion will find all tags on the current branch and return the highest one.
1717
Will increment: true
1818

1919
### Version in branch name
20-
If the branch has a version in it, then that version will be returned
20+
If the branch has a version in it, then that version will be returned.
2121

2222
Will increment: false
2323

@@ -27,7 +27,7 @@ If a branch with a version number in it is merged into the current branch, that
2727
Will increment: false
2828

2929
### GitVersionConfig.yaml
30-
If the next-version property is specified in the config file, it will be used as a version source.
30+
If the `next-version` property is specified in the config file, it will be used as a version source.
3131

3232
Will increment: false
3333

GitVersionCore.Tests/IntegrationTests/ReleaseBranchScenarios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void ReleaseBranchWithNextVersionSetInConfig()
8686
}
8787

8888
[Test]
89-
public void CanTakeVersionFromReleaseBranchWithTagOverriden()
89+
public void CanTakeVersionFromReleaseBranchWithTagOverridden()
9090
{
9191
var config = new Config();
9292
config.Branches["release[/-]"].Tag = "rc";

GitVersionCore.Tests/IntegrationTests/RemoteRepositoryScenarios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void GivenARemoteGitRepositoryAheadOfLocalRepository_ThenChangesShouldPul
5757
}
5858

5959
[Test]
60-
public void GivenARemoteGitRepositoryWhenCheckingOutDetachedhead_UsingExistingImplemenationThrowsException()
60+
public void GivenARemoteGitRepositoryWhenCheckingOutDetachedhead_UsingExistingImplementationThrowsException()
6161
{
6262

6363
using (var fixture = new RemoteRepositoryFixture(new Config()))

GitVersionCore.Tests/VersionCalculation/Strategies/MergeMessageBaseVersionStrategyTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Another commit message
8181
A commit message")]
8282
[TestCase(@"Merge branch 'release/Sprint_2.0_Holdings_Computed_Balances'")]
8383
[TestCase(@"Merge branch 'feature/fix-for-08.14-push'")]
84-
public void MergeMessagesThatsNotRelatedToGitVersion(string commitMessage)
84+
public void MergeMessagesThatIsNotRelatedToGitVersion(string commitMessage)
8585
{
8686

8787
var parents = GetParents(true);

GitVersionCore/BuildServers/GitHelper.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
namespace GitVersion
22
{
3+
using System;
34
using LibGit2Sharp;
45
using System.Collections.Generic;
56
using System.Linq;
@@ -164,6 +165,20 @@ static void CreateFakeBranchPointingAtThePullRequestTip(Repository repo, Authent
164165
repo.Checkout(fakeBranchName);
165166
}
166167

168+
internal static IEnumerable<DirectReference> GetRemoteTipsUsingUsernamePasswordCredentials(Repository repo, string repoUrl, string username, string password)
169+
{
170+
// This is a work-around as long as https://github.com/libgit2/libgit2sharp/issues/1099 is not fixed
171+
var remote = repo.Network.Remotes.Add(Guid.NewGuid().ToString(), repoUrl);
172+
try
173+
{
174+
return GetRemoteTipsUsingUsernamePasswordCredentials(repo, remote, username, password);
175+
}
176+
finally
177+
{
178+
repo.Network.Remotes.Remove(remote.Name);
179+
}
180+
}
181+
167182
static IEnumerable<DirectReference> GetRemoteTipsUsingUsernamePasswordCredentials(Repository repo, Remote remote, string username, string password)
168183
{
169184
return repo.Network.ListReferences(remote, (url, fromUrl, types) => new UsernamePasswordCredentials
@@ -185,7 +200,9 @@ static void CreateMissingLocalBranchesFromRemoteTrackingOnes(Repository repo, st
185200

186201
foreach (var remoteTrackingReference in repo.Refs.FromGlob(prefix + "*").Where(r => r.CanonicalName != remoteHeadCanonicalName))
187202
{
188-
var localCanonicalName = "refs/heads/" + remoteTrackingReference.CanonicalName.Substring(prefix.Length);
203+
var remoteTrackingReferenceName = remoteTrackingReference.CanonicalName;
204+
var branchName = remoteTrackingReferenceName.Substring(prefix.Length);
205+
var localCanonicalName = "refs/heads/" + branchName;
189206

190207
if (repo.Refs.Any(x => x.CanonicalName == localCanonicalName))
191208
{
@@ -203,6 +220,9 @@ static void CreateMissingLocalBranchesFromRemoteTrackingOnes(Repository repo, st
203220
{
204221
repo.Refs.Add(localCanonicalName, new ObjectId(symbolicReference.ResolveToDirectReference().TargetIdentifier), true);
205222
}
223+
224+
var branch = repo.Branches[branchName];
225+
repo.Branches.Update(branch, b => b.TrackedBranch = remoteTrackingReferenceName);
206226
}
207227
}
208228

GitVersionCore/Configuration/Wizard/EditConfigStep.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ protected override string GetPrompt(Config config)
3030
{
3131
return string.Format(@"Which would you like to change?
3232
33-
0) Save changes
33+
0) Save changes and exit
3434
1) Exit without saving
3535
2) Branch specific configuration
3636
3) Branch Increment mode (per commit/after tag) (Current: {0})

GitVersionCore/Configuration/Wizard/PickBranchingStrategy1Step.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ protected override string GetPrompt(Config config)
2727
{
2828
return @"GitVersion can try to recommend you a branching strategy based on a few questions.
2929
30-
Do you need to maintain mutliple versions of your application simultanously in production? (y/n)";
30+
Do you need to maintain multiple versions of your application simultaneously in production? (y/n)";
3131
}
3232

3333
protected override string DefaultResult

GitVersionCore/Configuration/Wizard/PickBranchingStrategy2Step.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ protected override StepResult HandleResult(string result, Queue<ConfigInitWizard
1313
Console.WriteLine("GitFlow is likely a good fit, the 'develop' branch can be used " +
1414
"for active development while stabilising the next release.");
1515
Console.WriteLine();
16-
Console.WriteLine("GitHubFlow is designed for a lightwieght workflow where master is always " +
16+
Console.WriteLine("GitHubFlow is designed for a lightweight workflow where master is always " +
1717
"good to deploy to production and feature branches are used to stabilise " +
18-
"features, once stable they can be released in the next release");
18+
"features, once stable they are merged to master and made available in the next release");
1919
steps.Enqueue(new PickBranchingStrategyStep());
2020
return StepResult.Ok();
2121
case "n":

0 commit comments

Comments
 (0)