Are you a command-line freak ? Do you want your automated shell scripts to run on Windows ? Do you wish to work with Perforce commands on Cygwin?
You would have experienced the difficulty of running perforce commands on cygwin. The problems which occur due to cygwin's inability to convert Windows paths to it's own /cygdrive/c equivalent.
Example:
$ p4 have pom.xml
Path '/cygdrive/c/p4_workspaces/guruss1_p4server2_workspace/depot/On-Prem/AA/7.5.0.0/application/adaptive-authentication\pom.xml' is not under client's root 'C:\p4_workspaces\guruss1_p4server2_workspace'.
You would have experienced the difficulty of running perforce commands on cygwin. The problems which occur due to cygwin's inability to convert Windows paths to it's own /cygdrive/c equivalent.
Example:
$ p4 have pom.xml
Path '/cygdrive/c/p4_workspaces/guruss1_p4server2_workspace/depot/On-Prem/AA/7.5.0.0/application/adaptive-authentication\pom.xml' is not under client's root 'C:\p4_workspaces\guruss1_p4server2_workspace'.
Solutions:
1) Use perforce cygwin client:
Perforce provide special 'p4.exe' which resolves all these issue. We just need to download it and make it available from default path.
Where to download ?
The available latest version which I found is http://filehost.perforce.com/perforce/r12.1/bin.cygwinx86/
The last release is made on May/2012 and hence it got the support for perforce's latest features like Streams, SSL , etc.
But perforce announced the discontinuity of support for Cygwin p4 client from May/2013
2) Add below function to your cygwin's ~/.bashrc
function p4() {
export PWD=`cygpath -wa .`
/cygdrive/c/Program\ Files/Perforce/p4.exe $@
}
This will take care of all path related issues and we can use the same perforce client delivered along with P4V.
3) Add AltRoots: field to your workspace ( or client) spec
Example:
AltRoots:
/cygdrive/c/p4_workspaces/guruss1_p4server2_workspace
This doesn't solve all the problems as I have observed. It works for 'p4 sync', but it didn't for 'p4 have'