Skip to content

Commit 9926123

Browse files
Improve listing of version strategies in how-it-works.md
1 parent 2186f66 commit 9926123

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

docs/input/docs/learn/how-it-works.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ GitVersion has three distinct steps for calculating versions in v3.
1919
1. If the current commit is tagged, the tag is used and build metadata
2020
(excluding commit count) is added. The other two steps will not execute.
2121
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)
2423
3. The highest base version is selected, using that base version as the new
2524
version is calculated.
2625

@@ -35,35 +34,36 @@ info below.
3534
**+** This version is out of context with the rest of the example. It is here
3635
simply to show what happens if the check is true.
3736

38-
### Base Version Strategies
37+
### Version Strategies
3938

4039
Currently we have the following strategies:
4140

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
4543
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
4745
GitVersion.yaml file
48-
* `MergeMessageBaseVersionStrategy` - Finds version numbers from merge messages
46+
* `MergeMessage` - Finds version numbers from merge messages
4947
(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
5149
calculating the next version which is dependent on the increment strategy of
5250
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
5353

5454
Each strategy needs to return an instance of `BaseVersion` which has the
5555
following properties:
5656

5757
* `Source` - Description of the source (e.g., `Merge message 'Merge 'release/3.0.0' into 'main'`)
5858
* `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)
6161
* `SemanticVersion` - SemVer of the base version strategy
6262
* `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
6464
null).
6565
* `BranchNameOverride` - When `useBranchName` or `{BranchName}` is used in the
6666
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
6868
first `-` or `/.` so `foo` ends up being evaluated as `foo`. If in doubt, just
6969
use null.

0 commit comments

Comments
 (0)