@@ -19,8 +19,7 @@ GitVersion has three distinct steps for calculating versions in v3.
19
19
1 . If the current commit is tagged, the tag is used and build metadata
20
20
(excluding commit count) is added. The other two steps will not execute.
21
21
2 . A set of strategies are evaluated to decide on the base version and some
22
- metadata about that version. These strategies include HighestReachableTag,
23
- NextVersionInConfig, MergedBranchWithVersion, VersionInBranchName etc.
22
+ metadata about that version. See [ Version Strategies] ( #version-strategies )
24
23
3 . The highest base version is selected, using that base version as the new
25
24
version is calculated.
26
25
@@ -35,35 +34,36 @@ info below.
35
34
** +** This version is out of context with the rest of the example. It is here
36
35
simply to show what happens if the check is true.
37
36
38
- ### Base Version Strategies
37
+ ### Version Strategies
39
38
40
39
Currently we have the following strategies:
41
40
42
- * ` HighestTagBaseVersionStrategy ` - Finds the highest reachable tag from the
43
- current branch
44
- * ` VersionInBranchBaseVersionStrategy ` - Extracts version information from the
41
+ * ` TaggedCommit ` - Extracts version information from all tags on the branch which are valid, and not newer than the current commit.
42
+ * ` VersionInBranchName ` - Extracts version information from the
45
43
branch name (e.g., ` release/3.0.0 ` will find ` 3.0.0 ` )
46
- * ` ConfigNextVersionBaseVersionStrategy ` - Returns the version from the
44
+ * ` ConfiguredNextVersion ` - Returns the version from the
47
45
GitVersion.yaml file
48
- * ` MergeMessageBaseVersionStrategy ` - Finds version numbers from merge messages
46
+ * ` MergeMessage ` - Finds version numbers from merge messages
49
47
(e.g., ` Merge 'release/3.0.0' into 'main' ` will return ` 3.0.0 ` )
50
- * ` FallbackBaseVersionStrategy ` - Always returns 0.0.0 and will be used for
48
+ * ` Fallback ` - Always returns 0.0.0 and will be used for
51
49
calculating the next version which is dependent on the increment strategy of
52
50
the effected branch (e.g. on main the next version is 0.0.1 or on develop it is 0.1.0)
51
+ * ` TrackReleaseBranches ` - TODO: Document this
52
+ * ` Mainline ` - TODO: Document this
53
53
54
54
Each strategy needs to return an instance of ` BaseVersion ` which has the
55
55
following properties:
56
56
57
57
* ` Source ` - Description of the source (e.g., ` Merge message 'Merge 'release/3.0.0' into 'main' ` )
58
58
* ` ShouldIncrement ` - Some strategies should have the version incremented,
59
- others do not (e.g., ` ConfigNextVersionBaseVersionStrategy ` returns false,
60
- ` HighestTagBaseVersionStrategy ` returns true)
59
+ others do not (e.g., ` ConfiguredNextVersion ` returns false,
60
+ ` TaggedCommit ` returns true)
61
61
* ` SemanticVersion ` - SemVer of the base version strategy
62
62
* ` BaseVersionSource ` - SHA hash of the source. Commits will be counted from
63
- this hash. Can be null (e.g., ` ConfigNextVersionBaseVersionStrategy ` returns
63
+ this hash. Can be null (e.g., ` ConfiguredNextVersion ` returns
64
64
null).
65
65
* ` BranchNameOverride ` - When ` useBranchName ` or ` {BranchName} ` is used in the
66
66
tag configuration, this allows the branch name to be changed by a base version.
67
- ` VersionInBranchBaseVersionStrategy ` uses this to strip out anything before the
67
+ ` VersionInBranchName ` uses this to strip out anything before the
68
68
first ` - ` or ` /. ` so ` foo ` ends up being evaluated as ` foo ` . If in doubt, just
69
69
use null.
0 commit comments