Skip to content

Commit e739852

Browse files
author
roeil
committed
docs
1 parent 4d15893 commit e739852

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/input/docs/reference/configuration.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,40 @@ Date and time in the format `yyyy-MM-ddTHH:mm:ss` (eg `commits-before:
624624
2015-10-23T12:23:15`) to setup an exclusion range. Effectively any commit before
625625
`commits-before` will be ignored.
626626

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+
::: {.alert .alert-warning}
658+
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.
659+
:::
660+
627661
### merge-message-formats
628662

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

0 commit comments

Comments
 (0)