I live in Silicon Valley. I'm really into machine learning and Formula 1. I'm 24 years old. More about me…

Friend me up! Here's where I'm at…

LinkedIn
Flickr
Delicious

Introduce yourself! Feel free to IM (Jabber/Gtalk) or email me.

Top Posts:
So I went to Startup School
Waking from a 64-bit nightmare
A quick foray into linear algebra and Python: tf-idf
Explaining my addiction
The importance of being abstract

Top Commentors:
Paul Stamatiou (4)
Gordon (4)
Arthur (2)
Anton Lindstrom (2)
m13 (2)

Friends
James Broad
Mike Speiser
Mike Heijmans
Annie Lausier
Jay Liew
Gabriel Serafini
Kevin Pratt
Ben Wann
Bart Chapin

Recommended Reading
Joel on Software
Rands in Repose
Paul Graham
Gary Vaynerchuk
Coding Horror
xkcd

All content © 2008 Tim Trueman unless otherwise noted.

Subscribe in a reader Article archives

Using Perforce for multiple projects

January 9, 2008 Link

Having used Perforce for multiple projects, I just wanted to share this little trick about using Perforce for multiple projects. You will want to create multiple clients for every logical project you are doing. To get started put this in your ~/.bash_profile:

export P4CONFIG='.P4CONFIG'

cluster

What that does is tells p4 to check for its configuration in whatever directory you execute the p4 command. It then keeps moving up in the directory structure until it finds a .P4CONFIG file. For instance, imagine you’re in a web application project and you are exploring the javascript files in a folder called “js” in the root of the project files and run a p4 sync from there. The p4 sync would look for a .P4CONFIG in the current “js” folder, fail to find one and then move up to the root where it would find the project specific .P4CONFIG. Now what shall we put in that project specific .P4CONFIG?

Save the follow snippet into a .P4CONFIG file inside a folder you want to check all the code out to, then run p4 client, edit it to include just the directories you want, then run p4 sync and you’re golden!

P4EDITOR=vim
P4CLIENT=jschmo-foo
P4USER=jschmo
P4PASSWD=iknowkungfoo
P4PORT=perforce.someinternalserver.domain.com:1666

I use that client name because it’s easy to track down who made a change and for what project. If this doesn’t work for you try to pull in your bash profile manually with this command:

source ~/.bash_profile

Have your say

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Safari hates me