Skip to content

Commit 1f3732b

Browse files
committed
Rename isDevelop to tracksReleaseBranches
1 parent 31de062 commit 1f3732b

9 files changed

+126
-59
lines changed

docs/configuration.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,23 +144,23 @@ branches:
144144
increment: Patch
145145
prevent-increment-of-merged-branch-version: true
146146
track-merge-target: false
147-
is-develop: false
147+
tracks-release-branches: false
148148
is-release-branch: false
149149
releases?[/-]:
150150
mode: ContinuousDelivery
151151
tag: beta
152152
increment: Patch
153153
prevent-increment-of-merged-branch-version: true
154154
track-merge-target: false
155-
is-develop: false
155+
tracks-release-branches: false
156156
is-release-branch: true
157157
features?[/-]:
158158
mode: ContinuousDelivery
159159
tag: useBranchName
160160
increment: Inherit
161161
prevent-increment-of-merged-branch-version: false
162162
track-merge-target: false
163-
is-develop: false
163+
tracks-release-branches: false
164164
is-release-branch: false
165165
(pull|pull\-requests|pr)[/-]:
166166
mode: ContinuousDelivery
@@ -169,31 +169,31 @@ branches:
169169
prevent-increment-of-merged-branch-version: false
170170
tag-number-pattern: '[/-](?<number>\d+)[-/]'
171171
track-merge-target: false
172-
is-develop: false
172+
tracks-release-branches: false
173173
is-release-branch: false
174174
hotfix(es)?[/-]:
175175
mode: ContinuousDelivery
176176
tag: beta
177177
increment: Patch
178178
prevent-increment-of-merged-branch-version: false
179179
track-merge-target: false
180-
is-develop: false
180+
tracks-release-branches: false
181181
is-release-branch: false
182182
support[/-]:
183183
mode: ContinuousDelivery
184184
tag: ''
185185
increment: Patch
186186
prevent-increment-of-merged-branch-version: true
187187
track-merge-target: false
188-
is-develop: false
188+
tracks-release-branches: false
189189
is-release-branch: false
190190
dev(elop)?(ment)?$:
191191
mode: ContinuousDeployment
192192
tag: unstable
193193
increment: Minor
194194
prevent-increment-of-merged-branch-version: false
195195
track-merge-target: true
196-
is-develop: true
196+
tracks-release-branches: true
197197
is-release-branch: false
198198
```
199199

@@ -252,7 +252,7 @@ Strategy which will look for tagged merge commits directly off the current
252252
branch. For example `develop` → `release/1.0.0` → merge into `master` and tag
253253
`1.0.0`. The tag is *not* on develop, but develop should be version `1.0.0` now.
254254

255-
### is-develop
255+
### tracks-release-branches
256256
Indicates this branch config represents develop in GitFlow.
257257

258258
### is-release-branch

src/GitVersionCore.Tests/ConfigProviderTests.CanWriteOutEffectiveConfiguration.approved.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ branches:
1717
increment: Patch
1818
prevent-increment-of-merged-branch-version: true
1919
track-merge-target: false
20-
is-develop: false
20+
tracks-release-branches: false
2121
is-release-branch: false
2222
is-mainline: true
2323
releases?[/-]:
@@ -26,7 +26,7 @@ branches:
2626
increment: Patch
2727
prevent-increment-of-merged-branch-version: true
2828
track-merge-target: false
29-
is-develop: false
29+
tracks-release-branches: false
3030
is-release-branch: true
3131
is-mainline: false
3232
features?[/-]:
@@ -35,7 +35,7 @@ branches:
3535
increment: Inherit
3636
prevent-increment-of-merged-branch-version: false
3737
track-merge-target: false
38-
is-develop: false
38+
tracks-release-branches: false
3939
is-release-branch: false
4040
is-mainline: false
4141
(pull|pull\-requests|pr)[/-]:
@@ -45,7 +45,7 @@ branches:
4545
prevent-increment-of-merged-branch-version: false
4646
tag-number-pattern: '[/-](?<number>\d+)[-/]'
4747
track-merge-target: false
48-
is-develop: false
48+
tracks-release-branches: false
4949
is-release-branch: false
5050
is-mainline: false
5151
hotfix(es)?[/-]:
@@ -54,7 +54,7 @@ branches:
5454
increment: Patch
5555
prevent-increment-of-merged-branch-version: false
5656
track-merge-target: false
57-
is-develop: false
57+
tracks-release-branches: false
5858
is-release-branch: false
5959
is-mainline: false
6060
support[/-]:
@@ -63,7 +63,7 @@ branches:
6363
increment: Patch
6464
prevent-increment-of-merged-branch-version: true
6565
track-merge-target: false
66-
is-develop: false
66+
tracks-release-branches: false
6767
is-release-branch: false
6868
is-mainline: true
6969
dev(elop)?(ment)?$:
@@ -72,7 +72,7 @@ branches:
7272
increment: Minor
7373
prevent-increment-of-merged-branch-version: false
7474
track-merge-target: true
75-
is-develop: true
75+
tracks-release-branches: true
7676
is-release-branch: false
7777
is-mainline: false
7878
ignore:

src/GitVersionCore.Tests/ConfigProviderTests.cs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void CanReadDocumentAndMigrate()
4242
tag: dev
4343
release[/-]:
4444
mode: continuousDeployment
45-
tag: rc
45+
tag: rc
4646
";
4747
SetupConfigFileContent(text);
4848

@@ -241,7 +241,10 @@ public void WarnOnExistingGitVersionConfigYamlFile(string path)
241241
SetupConfigFileContent(string.Empty, ConfigurationProvider.ObsoleteConfigFileName, path);
242242

243243
var logOutput = string.Empty;
244-
Action<string> action = info => { logOutput = info; };
244+
Action<string> action = info =>
245+
{
246+
logOutput = info;
247+
};
245248
using (Logger.AddLoggersTemporarily(action, action, action))
246249
{
247250
ConfigurationProvider.Verify(workingPath, repoPath, fileSystem);
@@ -258,7 +261,10 @@ public void WarnOnAmbiguousConfigFilesAtTheSameProjectRootDirectory(string path)
258261
SetupConfigFileContent(string.Empty, ConfigurationProvider.DefaultConfigFileName, path);
259262

260263
var logOutput = string.Empty;
261-
Action<string> action = info => { logOutput = info; };
264+
Action<string> action = info =>
265+
{
266+
logOutput = info;
267+
};
262268
Logger.SetLoggers(action, action, action);
263269

264270
ConfigurationProvider.Verify(workingPath, repoPath, fileSystem);
@@ -276,7 +282,10 @@ public void ThrowsExceptionOnAmbiguousConfigFileLocation(string repoConfigFile,
276282
var repositoryConfigFilePath = SetupConfigFileContent(string.Empty, repoConfigFile, repoPath);
277283
var workingDirectoryConfigFilePath = SetupConfigFileContent(string.Empty, workingConfigFile, workingPath);
278284

279-
WarningException exception = Should.Throw<WarningException>(() => { ConfigurationProvider.Verify(workingPath, repoPath, fileSystem); });
285+
WarningException exception = Should.Throw<WarningException>(() =>
286+
{
287+
ConfigurationProvider.Verify(workingPath, repoPath, fileSystem);
288+
});
280289

281290
var expecedMessage = string.Format("Ambiguous config file selection from '{0}' and '{1}'", workingDirectoryConfigFilePath, repositoryConfigFilePath);
282291
exception.Message.ShouldBe(expecedMessage);
@@ -288,7 +297,10 @@ public void NoWarnOnGitVersionYmlFile()
288297
SetupConfigFileContent(string.Empty);
289298

290299
var s = string.Empty;
291-
Action<string> action = info => { s = info; };
300+
Action<string> action = info =>
301+
{
302+
s = info;
303+
};
292304
using (Logger.AddLoggersTemporarily(action, action, action))
293305
{
294306
ConfigurationProvider.Provide(repoPath, fileSystem);

src/GitVersionCore.Tests/IntegrationTests/FeatureBranchScenarios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public void PickUpVersionFromMasterMarkedWithIsDevelop()
251251
"master", new BranchConfig()
252252
{
253253
Tag = "pre",
254-
IsDevelop = true,
254+
TracksReleaseBranches = true,
255255
}
256256
},
257257
{

src/GitVersionCore.Tests/TestEffectiveConfiguration.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
namespace GitVersionCore.Tests
22
{
3-
using System.Collections.Generic;
4-
using System.Linq;
53
using GitVersion;
64
using GitVersion.VersionFilters;
5+
using System.Collections.Generic;
6+
using System.Linq;
77

88
public class TestEffectiveConfiguration : EffectiveConfiguration
99
{
@@ -28,15 +28,15 @@ public TestEffectiveConfiguration(
2828
int buildMetaDataPadding = 4,
2929
int commitsSinceVersionSourcePadding = 4,
3030
IEnumerable<IVersionFilter> versionFilters = null,
31-
bool isDevelop = false,
32-
bool isRelease = false) :
31+
bool tracksReleaseBranches = false,
32+
bool isRelease = false) :
3333
base(assemblyVersioningScheme, assemblyInformationalFormat, versioningMode, gitTagPrefix, tag, nextVersion, IncrementStrategy.Patch,
3434
branchPrefixToTrim, preventIncrementForMergedBranchVersion, tagNumberPattern, continuousDeploymentFallbackTag,
3535
trackMergeTarget,
3636
majorMessage, minorMessage, patchMessage, noBumpMessage,
3737
commitMessageMode, legacySemVerPadding, buildMetaDataPadding, commitsSinceVersionSourcePadding,
3838
versionFilters ?? Enumerable.Empty<IVersionFilter>(),
39-
isDevelop, isRelease)
39+
tracksReleaseBranches, isRelease)
4040
{
4141
}
4242
}

src/GitVersionCore/BranchConfigurationCalculator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public static KeyValuePair<string, BranchConfig> GetBranchConfiguration(Commit c
1616
if (matchingBranches.Length == 0)
1717
{
1818
var branchConfig = new BranchConfig();
19-
ConfigurationProvider.ApplyBranchDefaults(config, branchConfig, isDevelop: true);
19+
ConfigurationProvider.ApplyBranchDefaults(config, branchConfig, tracksReleaseBranches: true);
2020
return new KeyValuePair<string, BranchConfig>(string.Empty, branchConfig);
2121
}
2222
if (matchingBranches.Length == 1)
@@ -114,7 +114,7 @@ static KeyValuePair<string, BranchConfig> InheritBranchConfiguration(bool onlyEv
114114
Increment = branchConfig.Increment,
115115
PreventIncrementOfMergedBranchVersion = branchConfig.PreventIncrementOfMergedBranchVersion,
116116
// If we are inheriting from develop then we should behave like develop
117-
IsDevelop = branchConfig.IsDevelop
117+
TracksReleaseBranches = branchConfig.TracksReleaseBranches
118118
});
119119
}
120120

@@ -142,7 +142,7 @@ static KeyValuePair<string, BranchConfig> InheritBranchConfiguration(bool onlyEv
142142
Increment = inheritingBranchConfig.Increment,
143143
PreventIncrementOfMergedBranchVersion = inheritingBranchConfig.PreventIncrementOfMergedBranchVersion,
144144
// If we are inheriting from develop then we should behave like develop
145-
IsDevelop = inheritingBranchConfig.IsDevelop
145+
TracksReleaseBranches = inheritingBranchConfig.TracksReleaseBranches
146146
});
147147
}
148148
}

src/GitVersionCore/Configuration/BranchConfig.cs

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,42 +17,72 @@ public BranchConfig(BranchConfig branchConfiguration)
1717
TagNumberPattern = branchConfiguration.TagNumberPattern;
1818
TrackMergeTarget = branchConfiguration.TrackMergeTarget;
1919
CommitMessageIncrementing = branchConfiguration.CommitMessageIncrementing;
20-
IsDevelop = branchConfiguration.IsDevelop;
20+
TracksReleaseBranches = branchConfiguration.TracksReleaseBranches;
2121
IsReleaseBranch = branchConfiguration.IsReleaseBranch;
2222
IsMainline = branchConfiguration.IsMainline;
2323
}
2424

2525
[YamlMember(Alias = "mode")]
26-
public VersioningMode? VersioningMode { get; set; }
26+
public VersioningMode? VersioningMode
27+
{
28+
get; set;
29+
}
2730

2831
/// <summary>
2932
/// Special value 'useBranchName' will extract the tag from the branch name
3033
/// </summary>
3134
[YamlMember(Alias = "tag")]
32-
public string Tag { get; set; }
35+
public string Tag
36+
{
37+
get; set;
38+
}
3339

3440
[YamlMember(Alias = "increment")]
35-
public IncrementStrategy? Increment { get; set; }
41+
public IncrementStrategy? Increment
42+
{
43+
get; set;
44+
}
3645

3746
[YamlMember(Alias = "prevent-increment-of-merged-branch-version")]
38-
public bool? PreventIncrementOfMergedBranchVersion { get; set; }
47+
public bool? PreventIncrementOfMergedBranchVersion
48+
{
49+
get; set;
50+
}
3951

4052
[YamlMember(Alias = "tag-number-pattern")]
41-
public string TagNumberPattern { get; set; }
53+
public string TagNumberPattern
54+
{
55+
get; set;
56+
}
4257

4358
[YamlMember(Alias = "track-merge-target")]
44-
public bool? TrackMergeTarget { get; set; }
45-
59+
public bool? TrackMergeTarget
60+
{
61+
get; set;
62+
}
63+
4664
[YamlMember(Alias = "commit-message-incrementing")]
47-
public CommitMessageIncrementMode? CommitMessageIncrementing { get; set; }
65+
public CommitMessageIncrementMode? CommitMessageIncrementing
66+
{
67+
get; set;
68+
}
4869

49-
[YamlMember(Alias = "is-develop")]
50-
public bool? IsDevelop { get; set; }
70+
[YamlMember(Alias = "tracks-release-branches")]
71+
public bool? TracksReleaseBranches
72+
{
73+
get; set;
74+
}
5175

5276
[YamlMember(Alias = "is-release-branch")]
53-
public bool? IsReleaseBranch { get; set; }
77+
public bool? IsReleaseBranch
78+
{
79+
get; set;
80+
}
5481

5582
[YamlMember(Alias = "is-mainline")]
56-
public bool? IsMainline { get; set; }
83+
public bool? IsMainline
84+
{
85+
get; set;
86+
}
5787
}
5888
}

src/GitVersionCore/Configuration/ConfigurationProvider.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
namespace GitVersion
22
{
3-
using System;
43
using GitVersion.Configuration.Init.Wizard;
54
using GitVersion.Helpers;
5+
using System;
66
using System.ComponentModel;
77
using System.IO;
88
using System.Linq;
@@ -106,10 +106,10 @@ public static void ApplyDefaultsTo(Config config)
106106
defaultIncrementStrategy: IncrementStrategy.Minor,
107107
defaultVersioningMode: VersioningMode.ContinuousDeployment,
108108
defaultTrackMergeTarget: true,
109-
isDevelop: true);
109+
tracksReleaseBranches: true);
110110

111111
// Any user defined branches should have other values defaulted after known branches filled in
112-
// This allows users to override one value of
112+
// This allows users to override one value of
113113
foreach (var branchConfig in configBranches)
114114
{
115115
ApplyBranchDefaults(config, branchConfig.Value);
@@ -165,7 +165,7 @@ public static void ApplyBranchDefaults(Config config,
165165
VersioningMode? defaultVersioningMode = null, // Looked up from main config
166166
bool defaultTrackMergeTarget = false,
167167
string defaultTagNumberPattern = null,
168-
bool isDevelop = false,
168+
bool tracksReleaseBranches = false,
169169
bool isReleaseBranch = false,
170170
bool isMainline = false)
171171
{
@@ -175,7 +175,7 @@ public static void ApplyBranchDefaults(Config config,
175175
branchConfig.PreventIncrementOfMergedBranchVersion = branchConfig.PreventIncrementOfMergedBranchVersion ?? defaultPreventIncrement;
176176
branchConfig.TrackMergeTarget = branchConfig.TrackMergeTarget ?? defaultTrackMergeTarget;
177177
branchConfig.VersioningMode = branchConfig.VersioningMode ?? defaultVersioningMode ?? config.VersioningMode;
178-
branchConfig.IsDevelop = branchConfig.IsDevelop ?? isDevelop;
178+
branchConfig.TracksReleaseBranches = branchConfig.TracksReleaseBranches ?? tracksReleaseBranches;
179179
branchConfig.IsReleaseBranch = branchConfig.IsReleaseBranch ?? isReleaseBranch;
180180
branchConfig.IsMainline = branchConfig.IsMainline ?? isMainline;
181181
}
@@ -300,7 +300,8 @@ public static void Init(string workingDirectory, IFileSystem fileSystem, IConsol
300300
var configFilePath = GetConfigFilePath(workingDirectory, fileSystem);
301301
var currentConfiguration = Provide(workingDirectory, fileSystem, applyDefaults: false);
302302
var config = new ConfigInitWizard(console, fileSystem).Run(currentConfiguration, workingDirectory);
303-
if (config == null) return;
303+
if (config == null)
304+
return;
304305

305306
using (var stream = fileSystem.OpenWrite(configFilePath))
306307
using (var writer = new StreamWriter(stream))

0 commit comments

Comments
 (0)