Skip to content

Commit d89c6b6

Browse files
authored
Merge pull request #2984 from asbjornu/feature/build-metadata-docs
`BuildMetaData` doesn't increment with every build
2 parents 64dc2dd + 197ba00 commit d89c6b6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

docs/input/docs/reference/variables.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Each property of the above JSON document is described in the below table.
6060
| `PreReleaseLabelWithDash` | The pre-release label prefixed with a dash. |
6161
| `PreReleaseNumber` | The pre-release number. |
6262
| `WeightedPreReleaseNumber` | A summation of branch specific `pre-release-weight` and the `PreReleaseNumber`. Can be used to obtain a monotonically increasing version number across the branches. |
63-
| `BuildMetaData` | The build metadata, usually representing number of commits since the `VersionSourceSha`. |
63+
| `BuildMetaData` | The build metadata, usually representing number of commits since the `VersionSourceSha`. Despite its name, will not increment for every build. |
6464
| `BuildMetaDataPadded` | The `BuildMetaData` padded with `0` up to 4 digits. |
6565
| `FullBuildMetaData` | The `BuildMetaData` suffixed with `BranchName` and `Sha`. |
6666
| `MajorMinorPatch` | `Major`, `Minor` and `Patch` joined together, separated by `.`. |

docs/input/docs/reference/version-increments.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ version.
1515

1616
## Approach
1717

18-
Semantic Versioning is all about _releases_, not builds. This means that the
19-
version only increases after you release, this directly conflicts with the
20-
concept of published CI builds. When you release the next version of your
18+
Semantic Versioning is all about _releases_, not commits or builds. This means
19+
that the version only increases after you release, this directly conflicts with
20+
the concept of published CI builds. When you release the next version of your
2121
library/app/website/whatever you should only increment major/minor or patch then
2222
reset all lower parts to 0, for instance given `1.0.0`, the next release should
2323
be either `2.0.0`, `1.1.0` or `1.0.1`.
@@ -26,17 +26,17 @@ Because of this, GitVersion works out what the next SemVer of your app is on
2626
each commit. When you are ready to release, you simply deploy the latest built
2727
version and tag the commit it was created from. This practice is called
2828
[continuous delivery][continuous-delivery]. GitVersion will increment the
29-
_metadata_ for each build so you can tell builds apart. For example `1.0.0+5`
29+
_metadata_ for each commit so you can tell them apart. For example `1.0.0+5`
3030
followed by `1.0.0+6`. It is important to note that build metadata _is not part
3131
of the semantic version; it is just metadata!_.
3232

3333
All this effectively means that GitVersion will produce the same version NuGet
3434
package each commit until you tag a release.
3535

3636
This causes problems for people as NuGet and other package managers do not
37-
support multiple packages with the same version with only different metadata.
38-
There are a few ways to handle this problem depending on what your requirements
39-
are:
37+
support multiple packages with the same version where only the metadata is
38+
different. There are a few ways to handle this problem depending on what your
39+
requirements are:
4040

4141
### 1. GitFlow
4242

0 commit comments

Comments
 (0)