By design, Perforce does not allow filenames with wildcards @#%*
be added. It is giving this error:
Can't add filenames with wildcards [@#%*] in them.
Use -f option to force add.
However, I have SASS files that have @
on them to support mixins. For example:
[email protected]
[email protected]
What is the best workaround to have these files added to Perforce, with most minimal disruption on checkin, checkout, compile, build, and deploy flow ?
You can add files with Perforce wildcard characters in them. As the 'p4 help add' page documents:
To add files with filenames that contain wildcard characters, specify the -f flag. Filenames that contain the special characters '@', '#', '%' or '*' are reformatted to encode the characters using ASCII hexadecimal representation. After the files are added, you must refer to them using the reformatted file name, because Perforce does not recognize the local filesystem name.
The requirement to uniformly refer to the filename from then on using the encoded '%40' is annoying, I agree, but it does work.
Here's a short example:
$ touch '[email protected]'
$ p4 add '[email protected]'
The file named '[email protected]' contains wildcards [@#%*].
Can't add filenames with wildcards [@#%*] in them.
Use -f option to force add.
$ p4 add -f '[email protected]'
//depot/carbon-fiber-%402X.png#1 - opened for add
/path/to/[email protected] - empty, assuming text.
$ p4 submit -d added-carbon-fibre
Submitting change 2.
Locking 1 files ...
add //depot/carbon-fiber-%402X.png#1
Change 2 submitted.
$ p4 files //...
//depot/carbon-fiber-%402X.png#1 - add change 2 (text)
$ p4 fstat //depot/carbon-fiber-%402X.png
... depotFile //depot/carbon-fiber-%402X.png
... clientFile /path/to/[email protected]
... isMapped
... headAction add
... headType text
... headTime 1466547058
... headRev 1
... headChange 2
... headModTime 1466547033
... haveRev 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With