Issues using perforce command line under cygwin

command linecygwinperforce

So, virtually cannot use the the perforce command line for anything other than syncing.
My workspace root is mapped to C:\
Here's a line of my client spec:
//claims1.0/main/… //cthiel/code/claims1.0/main/…

Any time I fire up cygwin and attempt to work with any files in my depot (such as p4 edit ), I get an error along the lines of:
Path '/cygdrive/c/code/commonTest/main.p4ignore' is not under client's root 'C:\'.

The paths aren't matching up, because the equivalent of C:\ for cygwyn is /cygdrive/c. So it's never able to find files with the perforce command line.

Is there a way to fix this? It's highly annoying.

Best Answer

Found a solution:
Add this to your .bashrc:

function p4() {
export PWD=`cygpath -wa .`
/cygdrive/c/Program\ Files/Perforce/p4.exe $@
}

Works like a charm for me.