Skip to content

Commit 4290a39

Browse files
committed
Moved content from versioning-mode to mainline-development to avoid duplication.
1 parent 21f04ee commit 4290a39

File tree

2 files changed

+47
-33
lines changed

2 files changed

+47
-33
lines changed
Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,46 @@
11
# Mainline development
2-
Mainline development is enabled when using [GitHubFlow](../git-branching-strategies/githubflow.md) or any other strategy where you develop on `master`. The main rule of mainline development is that **master is always in a state that it could be deployed to production**. This means that pull requests should not be merged until they are ready to go out.
2+
Mainline Development is enabled when using
3+
[GitHubFlow](../git-branching-strategies/githubflow.md) or any other strategy
4+
where you develop on `master`. The main rule of mainline development is that
5+
**master is always in a state that it could be deployed to production**. This
6+
means that pull requests should not be merged until they are ready to go out.
37

4-
To properly achieve mainline development you need confidence in your test suite as if it goes green against a PR then you are confident that you can merge and release that pull request. Another property of mainline development is normally that you fix going forward, not revert. When an issue is discovered with a release, add a test or some sort of check to make sure it won't happen again, fix the issue, then do a release with the fix.
8+
To properly achieve mainline development you need confidence in your test suite
9+
as if it goes green against a PR then you are confident that you can merge and
10+
release that pull request. Another property of mainline development is normally
11+
that you fix going forward, not revert. When an issue is discovered with a
12+
release, add a test or some sort of check to make sure it won't happen again,
13+
fix the issue, then do a release with the fix.
514

6-
Like all things, it is an approach and will work for some people and not for others. GitVersion is unique in the fact that it works very well with mainline development and the version numbers it generates are *predictive* and indicate what the next version to be released is. Most other approaches require bumping the version number before the release which means that the version being built and the version number which will be deployed are often different.
15+
Like all things, it is an approach and will work for some people and not for
16+
others. GitVersion is unique in the fact that it works very well with mainline
17+
development and the version numbers it generates are *predictive* and indicate
18+
what the next version to be released is. Most other approaches require bumping
19+
the version number before the release which means that the version being built
20+
and the version number which will be deployed are often different.
21+
22+
This mode is great if you do not want to tag each release because you simply
23+
deploy every commit to master. The behaviour of this mode is as follows:
24+
25+
1. Calclate a base version (likely a tag in this mode)
26+
2. Walk all commits from the base version commit
27+
3. When a merge commit is found:
28+
- Calculate increments for each direct commit on master
29+
- Calculate the increment for the branch
30+
4. Calculate increments for each remaining direct commit
31+
5. For feature branches then calculate increment for the commits so far on your
32+
feature branch.
33+
34+
If you *do not want* GitVersion to treat a commit or a pull request as a release
35+
and increment the version you can use `+semver: none` or `+semver: skip` in a
36+
commit message to skip incrementing for that commit.
37+
38+
Here is an example of what mainline development looks like:
39+
40+
![Mainline mode](./img/mainline-mode.png)
41+
42+
**WARNING:** This approach can slow down over time, we recommend to tag
43+
intermitently (maybe for minor or major releases) because then GitVersion
44+
will start the version calculation from that point. Much like a snapshot in an
45+
event sourced system. We will probably add in warnings to tag when things are
46+
slowing down.

docs/reference/versioning-mode.md

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,7 @@ Sometimes you just want the version to keep changing and deploy continuously.
1111
In this case, [Continuous Deployment](/reference/continuous-deployment) is a
1212
good mode to operate GitVersion by.
1313

14-
## Mainline development
15-
[Mainline development](/reference/mainline-development) works more like the
16-
[Continuous Delivery mode](/reference/continuous-delivery), except that
17-
it tells GitVersion to *infer* releases from merges and commits to `master`.
18-
19-
This mode is great if you do not want to tag each release because you simply
20-
deploy every commit to master. The behaviour of this mode is as follows:
21-
22-
1. Calclate a base version (likely a tag in this mode)
23-
2. Walk all commits from the base version commit
24-
3. When a merge commit is found:
25-
- Calculate increments for each direct commit on master
26-
- Calculate the increment for the branch
27-
4. Calculate increments for each remaining direct commit
28-
5. For feature branches then calculate increment for the commits so far on your
29-
feature branch.
30-
31-
If you *do not want* GitVersion to treat a commit or a pull request as a release
32-
and increment the version you can use `+semver: none` or `+semver: skip` in a
33-
commit message to skip incrementing for that commit.
34-
35-
Here is an example of what mainline development looks like:
36-
37-
![Mainline mode](./img/mainline-mode.png)
38-
39-
**WARNING:** This approach can slow down over time, we recommend to tag
40-
intermitently (maybe for minor or major releases) because then GitVersion
41-
will start the version calculation from that point. Much like a snapshot in an
42-
event sourced system. We will probably add in warnings to tag when things are
43-
slowing down.
14+
## Mainline Development
15+
[Mainline Development](/reference/mainline-development) works more like the
16+
[Continuous Delivery](/reference/continuous-delivery), except that it tells
17+
GitVersion to *infer* releases from merges and commits to `master`.

0 commit comments

Comments
 (0)