I’ve been using Perforce on for various things during the last 2 years. The first thing that was really annoying, and now has become so annoying that it is about to cross into being outright hostile about Perforce is…
There is no way to find out what’s going on with the files in your workspace, without a slow roundtrip to the server for every file in the local workspace directory!
Yes, Virginia, you have to iterate through each friggin’ file in the local workspace, and ask the server what it knows about it… multiple times…
Finding the “status” of the local workspace directory is an operation that is so ubiquitous when working with software that it is really beyond my head why Perforce doesn’t even have a single command for it. Here are some cases where this sort of “local tree status” is useful:
- You have applied a diff (patchfile) on top of a checkout, and you want to see which files were affected, and how they changed.
- You have deleted directory “mumble”, extracted “mumble-1.2″ and renamed it to “mumble” and you want to see what files changed, so you can import the new version of the “mumble” component.
- A fellow developer wants you to test some local changes he made, so he sends you a couple of files, which you want to diff with your latest checkout of these files.
The best recommendation I’ve found so far is listed in one of the “Technical Notes” of the Perforce documentation, and it goes something like this:
p4 diff -sd ... | p4 -x - delete find . '!' -type d | p4 -x - add 2>&1 | fgrep -v existing p4 diff -se ... | p4 -x - edit
That’s crazy. The equivalent command in, say, Subversion is something like:
svn status | more
or even something shorter:
svn stat | more
With Mercurial things are even faster, and quite unsurprisingly similar to what Subversion supports:
hg addremove hg status | more
That’s it… You can run “hg add” on new files, “hg delete” on files which are gone from the local workspace, and then look at the current status of your local workspace, and it all happens in the short timespan of a second or so: that’s how long it takes to type the two commands and watch Mercurial blaze through the file list.
Knowing that there are systems out there which are fast, free software and more featureful, every time I have to run a script with the Perforce commands needed to tell the repository what it should be smart enough to find on its own, and then wait for half an hour for a Perforce server across half of the world to get in sync with reality, a stream of endless frustrated curses attempts to escape my mouth :-/
The next time someone asks me which SCM system to use, and someone suggests a commercial, slow, feature-restricted SCM system, it will be very hard to convince me that the free software SCM systems we have today don’t fit the bill…
VERY very hard…