Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between dots and asterik in Perforce mapping rules?

Tags:

perforce

I understand that //depot/foo/... will map all the 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.

like image 491
ripper234 Avatar asked Dec 21 '22 15:12

ripper234


1 Answers

... recurses, * does not. If you want to match all files at a given location and all files below that location, you use ...; if you want to match only files in a given folder, use *.

With your example

  • //depot/foo/* will only match files in the 'foo' folder (if there are any)
  • //depot/foo/... will match files in the foo folder as well as any files beneath foo

For simple client specs, you want to use ... so that you get all files in all subdirectories in a depot. You might use the * character in a clientspec when you want to match files in a specific folder and nothing underneath. As an example

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

The above will (in order), add all files in the //depot/foo location. Then it will remove everything in //depot/foo/test (including files in the test folder). The third line will then add back in just the files in the test folder and nothing underneath.

like image 185
Mark Avatar answered Apr 16 '23 15:04

Mark