Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perforce and submodules

At work we are using Perforce and I wonder if it's possible to do submodules with it with versioning.

For example I have library A used by projects B and C.

I want to make it so that when I get revision of B I also get A in subfolder:

B

---=> A(v1)

Same goes for project C, but it would need newer version of library.

C

---=> A(v1.2)

I know this kind of thing is possible with Git, but could not find anything on it for Perforce.

Thanks, Leonty

like image 394
Leonti Avatar asked Oct 13 '25 07:10

Leonti


1 Answers

Perforce really handles this sort of thing with views and paths. These let you assemble the right set of files to put into a workspace (or branch or label). Since a Perforce repository can contain all of the components or modules for all your products, you just select which ones you want in a working data set. You don't need the submodule (or SVN external) concept to pull in data from another repository.

You can use template workspaces to make sure that developers get the right set of files to work on. You can be a little more rigorous and write some custom tools (possibly in the Perforce broker) to provide some structure.

The closest equivalent to using submodules is found in Perforce streams, where the paths define what goes into a stream. Stream paths are inherited by child streams. This isn't a direct equivalent though.

like image 184
randy-wandisco Avatar answered Oct 16 '25 06:10

randy-wandisco



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!