Skip to content

Commit 212fe9f

Browse files
committed
Docs changes
1 parent 3ce7d15 commit 212fe9f

File tree

1 file changed

+44
-3
lines changed

1 file changed

+44
-3
lines changed

docs/input/docs/reference/configuration.md

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ branches:
191191
is-main-branch: false
192192
ignore:
193193
sha: []
194+
paths: []
194195
mode: ContinuousDelivery
195196
label: '{BranchName}'
196197
increment: Inherit
@@ -208,7 +209,7 @@ tracks-release-branches: false
208209
is-release-branch: false
209210
is-main-branch: false
210211
```
211-
<sup><a href='/docs/workflows/GitFlow/v1.yml#L1-L166' title='Snippet source file'>snippet source</a> | <a href='#snippet-/docs/workflows/GitFlow/v1.yml' title='Start of snippet'>anchor</a></sup>
212+
<sup><a href='/docs/workflows/GitFlow/v1.yml#L1-L167' title='Snippet source file'>snippet source</a> | <a href='#snippet-/docs/workflows/GitFlow/v1.yml' title='Start of snippet'>anchor</a></sup>
212213
<!-- endSnippet -->
213214

214215
The supported built-in configuration for the `GitHubFlow` workflow (`workflow: GitHubFlow/v1`) looks like:
@@ -315,6 +316,7 @@ branches:
315316
is-main-branch: false
316317
ignore:
317318
sha: []
319+
paths: []
318320
mode: ContinuousDelivery
319321
label: '{BranchName}'
320322
increment: Inherit
@@ -332,7 +334,7 @@ tracks-release-branches: false
332334
is-release-branch: false
333335
is-main-branch: false
334336
```
335-
<sup><a href='/docs/workflows/GitHubFlow/v1.yml#L1-L115' title='Snippet source file'>snippet source</a> | <a href='#snippet-/docs/workflows/GitHubFlow/v1.yml' title='Start of snippet'>anchor</a></sup>
337+
<sup><a href='/docs/workflows/GitHubFlow/v1.yml#L1-L116' title='Snippet source file'>snippet source</a> | <a href='#snippet-/docs/workflows/GitHubFlow/v1.yml' title='Start of snippet'>anchor</a></sup>
336338
<!-- endSnippet -->
337339

338340
The preview built-in configuration (experimental usage only) for the `TrunkBased` workflow (`workflow: TrunkBased/preview1`) looks like:
@@ -424,6 +426,7 @@ branches:
424426
pre-release-weight: 30000
425427
ignore:
426428
sha: []
429+
paths: []
427430
mode: ContinuousDelivery
428431
label: '{BranchName}'
429432
increment: Inherit
@@ -441,7 +444,7 @@ tracks-release-branches: false
441444
is-release-branch: false
442445
is-main-branch: false
443446
```
444-
<sup><a href='/docs/workflows/TrunkBased/preview1.yml#L1-L100' title='Snippet source file'>snippet source</a> | <a href='#snippet-/docs/workflows/TrunkBased/preview1.yml' title='Start of snippet'>anchor</a></sup>
447+
<sup><a href='/docs/workflows/TrunkBased/preview1.yml#L1-L101' title='Snippet source file'>snippet source</a> | <a href='#snippet-/docs/workflows/TrunkBased/preview1.yml' title='Start of snippet'>anchor</a></sup>
445448
<!-- endSnippet -->
446449

447450
The details of the available options are as follows:
@@ -621,6 +624,44 @@ Date and time in the format `yyyy-MM-ddTHH:mm:ss` (eg `commits-before:
621624
2015-10-23T12:23:15`) to setup an exclusion range. Effectively any commit before
622625
`commits-before` will be ignored.
623626

627+
#### paths
628+
A sequence of regular expressions that represent paths in the repository. Commits that modify these paths will be excluded from version calculations. For example, to filter out commits that belong to `docs`:
629+
```yaml
630+
ignore:
631+
paths:
632+
- ^docs\/
633+
```
634+
##### *Monorepo*
635+
This ignore config can be used to filter only those commits that belong to a specific project in a monorepo.
636+
As an example, consider a monorepo consisting of subdirectories for `ProjectA`, `ProjectB` and a shared `LibraryC`. For GitVersion to consider only commits that are part of `projectA` and shared library `LibraryC`, a regex that matches all paths except those starting with `ProjectA` or `LibraryC` can be used. Either one of the following configs would filter out `ProjectB`.
637+
* Specific match on `/ProjectB/*`:
638+
```yaml
639+
ignore:
640+
paths:
641+
- `^\/ProductB\/.*`
642+
```
643+
* Negative lookahead on anything other than `/ProjectA/*` and `/LibraryC/*`:
644+
```yaml
645+
ignore:
646+
paths:
647+
- `^(?!\/ProductA\/|\/LibraryC\/).*`
648+
```
649+
A commit having changes only in `/ProjectB/*` path would be ignored. A commit having changes in the following paths wouldn't be ignored:
650+
* `/ProductA/*`
651+
* `/LibraryC/*`
652+
* `/ProductA/*` and `/LibraryC/*`
653+
* `/ProductA/*` and `/ProductB/*`
654+
* `/LibraryC/*` and `/ProductB/*`
655+
* `/ProductA/*` and `/ProductB/*` and `/LibraryC/*`
656+
657+
:::
658+
Note: The `ignore.paths` configuration is case-sensitive. This can lead to unexpected behavior on case-insensitive file systems, such as Windows. To ensure consistent matching regardless of case, you can prefix your regular expressions with the case-insensitive flag `(?i)`. For example, `(?i)^docs\/` will match both `docs/` and `Docs/`.
659+
:::
660+
661+
::: {.alert .alert-warning}
662+
A commit is ignored by the `ignore.paths` configuration only if **all paths** changed in that commit match one or more of the specified regular expressions. If a path in a commit does not match any one of the ignore patterns, that commit will be included in version calculations.
663+
:::
664+
624665
### merge-message-formats
625666

626667
Custom merge message formats to enable identification of merge messages that do not

0 commit comments

Comments
 (0)