Skip to content

Commit 6a075ec

Browse files
committed
PR Feedback addressed
1 parent 9ca4c3e commit 6a075ec

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

docs/configuration.md

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,9 @@ values, but here they are if you need to:
244244
This is the regex which is used to match the current branch to the correct branch configuration.
245245

246246
### source-branches
247-
Because git is a directed graph GitVersion sometimes cannot tell which branch the current branch was branched from.
247+
Because git commits only refer to parent commits (not branches) GitVersion sometimes cannot tell which branch the current branch was branched from.
248248

249-
Take this graph
249+
Take this commit graph
250250

251251
```
252252
* release/1.0.0 * feature/foo
@@ -271,18 +271,41 @@ By looking at this graph, you cannot tell which of these scenarios happened:
271271
- Add a commit to both release/1.0.0 and feature/foo
272272
- feature/foo is the base for release/1.0.0
273273

274-
Or put more simply, what branch was created first, `release/1.0.0` or `feature/foo`.
274+
Or put more simply, you cannot tell which branch was created first, `release/1.0.0` or `feature/foo`.
275275

276-
To resolve this issue, we give GitVersion a hint to our branching workflows by telling it what types of branches it can be created from. For example feature branches are by default configured to have the following source branches:
276+
To resolve this issue, we give GitVersion a hint about our branching workflows by telling it what types of branches a branch can be created from. For example, feature branches are, by default, configured to have the following source branches:
277277

278-
`sourceBranches: ['master', 'develop', 'feature', 'hotfix', 'support']`
278+
`source-branches: ['master', 'develop', 'feature', 'hotfix', 'support']`
279279

280-
This means that we will never bother to evaluate pull request branches as merge base options, being explicit like this helps GitVersion be much faster too.
280+
This means that we will never bother to evaluate pull request branches as merge base options and being explicit in this way also improves the performance of GitVersion.
281281

282282
### is-source-branch-for
283-
The reverse of the above setting. This property was introduced to keep it easy to extend GitVersion's config.
283+
The reverse of `source-branches`. This property was introduced to keep it easy to extend GitVersion's config.
284284

285-
When you add a new branch type this allows you to specify both source-branches for the new branch, and also add the new branch to existing branch configurations. For example if you create a new branch called `unstable` you could set a value of `['release', 'master', 'feature']` etc.
285+
It exists to make it easier to extend GitVersion's configuration. If only `source-branches` exists and you add a new branch type, for instance `unstable/`, you then need to re-define the `source-branches` configuration value for existing branches (like feature/) to now include the new unstable branch.
286+
287+
A complete example:
288+
289+
```
290+
branches:
291+
unstable:
292+
regex: ...
293+
is-source-branch-for: ['master', 'develop', 'feature', 'hotfix', 'support']
294+
```
295+
296+
Without this configuration value you would have to do:
297+
298+
299+
```
300+
branches:
301+
unstable:
302+
regex: ...
303+
feature:
304+
source-branches: ['unstable', 'develop', 'feature', 'hotfix', 'support']
305+
release:
306+
source-branches: ['unstable', 'develop']
307+
etc...
308+
```
286309

287310
### branches
288311
The header for all the individual branch configuration.

0 commit comments

Comments
 (0)