What is the difference between dots and asterik in Perforce matching rules?

I understand that //depot/foo/... display all files and folders under //depot/foo/ . So what does //depot/foo/* do? I was told not to use it and would like to understand why.

+4
source share
1 answer

... recurses, * does not. If you want to map all files in a specific location and all files below that location, you use ... If you want to map only files in a given folder, use *

In your example

  • // depot / foo / * will only match the files in the "foo" folder (if any)
  • // depot / foo / ... will match the files in the foo folder, as well as any files below foo

For simple client specifications, you want to use "..." so that all files are in all subdirectories in the repository. You can use the "*" symbol in the client specifier if you want to map files in a specific folder and nothing below it. As an example

 //depot/foo/... //myclient/depot/foo/... -//depot/foo/test/... //myclient/depot/foo/test/... //depot/foo/test/* //myclient/depot/foo/test/* 

The above (in order) will add all the files to the // depot / foo folder. Then it will delete everything in // depot / foo / test (including files in the test folder). The third line will then add back only the files in the test folder and nothing below.

NTN

+9
source

Source: https://habr.com/ru/post/1346945/


All Articles