bergyman
bergyman

Reputation: 4557

Issues using perforce command line under cygwin

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.

Upvotes: 20

Views: 7291

Answers (6)

Codex24
Codex24

Reputation: 323

Please note, the Perforce CLI client for CygWin has been deprecated and will be no longer supported after 5/1/2013, according to the Perforce web site. There is discussion of this topic at the Perforce support forums, including a poll which attempts to gauge the level of interest in continuing support for the CygWin client. Support is being discontinued for financial reasons (license fees to Redhat for commercial Cygwin distribution); so if sufficient interest is shown, that decision may be reconsidered.

If you use the P4 Cygwin client, ever have, or have any interest in the subject, I urge you to participate in the poll. Thanks.

Upvotes: 4

Kunal
Kunal

Reputation: 3535

Alt root seems to work fine for me. However I am not using cygwin. My source code resides in linux server and I have client in windows machine. I have mapped server's workspace on windows using network drive.

Upvotes: 0

Earl
Earl

Reputation: 181

A modified version of the .bashrc function to avoid the cygpath overhead and finding p4.exe executable in the PATH automatically:

function p4() {
    PWD= `which p4` "$@"
}

Upvotes: 1

Douglas Leeder
Douglas Leeder

Reputation: 53310

You can setup altroots in your client spec, that might cover this?

Although the cygwin p4 is the solution I'd go for. But I would go for the latest version: http://filehost.perforce.com/perforce/r09.2/bin.cygwinx86/p4.exe - it'll work with any older server, but will have fewer bugs.

Upvotes: 5

bergyman
bergyman

Reputation: 4557

Even mo' betta':
Use the cygwin p4 client: http://filehost.perforce.com/perforce/r07.2/bin.cygwinx86/p4.exe

Just make sure this is in your path before the Perforce/p4.exe. Et voila.

Upvotes: 11

bergyman
bergyman

Reputation: 4557

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.

Upvotes: 34

Related Questions