Use value matching pattern files
Find how to use value matching filter pattern rules in configuration files.
Read time 2 minutesLast updated 21 days ago
Use value matching filter pattern rules to set up specific client configuration files. A value matching pattern file assigns a value to items that match specified patterns. These files contain one pattern per line. Unity Version Control (UVCS) uses the path of each item to check whether it matches any of the rules and then returns the assigned value.
Value filter pattern files in UVCS
UVCS has the following value matching pattern files:- Compression type ()
compression.conf - EOL sequence conversion ()
eolconversion.conf - File type ()
filetypes.conf
filetypes.conf:compression.confeolconversion.conf#Rule types
There are four types of patterns you can use with value matching pattern files. For more information on which rule types take precedence when you use multiple, refer to pattern hierarchy.Extension rules
Extension rules define the exact extension of the files to match. These apply to the characters after the last..in.html.en.rexcompression.conf example
In the following example, a file such as/theme/images/background.png/src/client/main.cpp.png none.c zip.cpp zip
Path rules
Path rules compare the full path of an item and if they match, apply the rule value to that item.eolconversion.conf example
In the following example, you use automatic EOL conversion for/src/main.c/lib/core/Calculator.csCRLF/src/main.c auto/lib/core/Calculator.cs CRLF
Name rules
Name rules exactly match the item name.filetypes.conf example
In the following example, you set a file such as/my-app/wwwroot/img/header.png/README.md or /src/doc/README.mdheader.png:binREADME.md:txt
Wildcard rules
You can enhance path rules with wildcard sequences:- matches any number of consecutive characters except the directory separator
*./ - matches any number of consecutive characters, including the directory separator
**./ - matches a single character, excluding the directory separator
?./
compression.conf example
If you apply this compression filter, files such as the following don’t use compression:/**/images/**/*.* none/src/client/core/lib_01.? zip
/wwwroot/dist/images/mandatory-intermediate-directory/img.png/doc/images/builder/readme.txt
/src/client/core/lib_01.c/src/client/core/lib_01.h/src/client/core/lib_01.o
Pattern hierarchy
UVCS uses the patterns in a file to match the path of an item. Some pattern formats take precedence over others. The following shows the hierarchy of pattern formats:- Path rules
- Name rules
- Extension rules
- Wildcard rules
filetypes.conf example
In the following example,/src/main/bootstrap/compile.execompile.exe/build/release/compile.execompile.exe:txt/src/main/bootstrap/compile.exe:bin
eolconversion.conf example
In the following example, you convert the EOL sequences toLF/src/java/<subdir>//src/java/<subdir>/.java/src/java/<subdir>//src/java/test/complex/ExtremelyRareScenarioTest.java/src/java/**/*.* LF.java:auto