views:

152

answers:

1

Problem statement

The entire codebase was accessible to everyone till now. Now I need to enforce people get code of only those modules which they will work on, for other modules they will get a library as in lib. Assuming we have two modules right now

thinkbot (HEAD)

-> assemblebot (tree/subdir)

 -> include

 -> source

 -> lib

 -> obj

-> vpl (tree/subdir)

 -> include

 -> source

 -> lib

 -> obj

-> include

-> source -> bin`

Now if someone is working on vpl module he will get include and source folder containing the code and from assemblebot module he will get a lib. So when he makes changes and compiles from HEAD things will work out from him.

Guys how do I implement this in Git ? Pointers on What to read ? Command snippets would be great ?

Regards Ankur

+8  A: 

At the moment, the only way I can think of is by using submodules. The two modules (assemblebot, vpl) would each be a submodule, and the rest of the tree would be in the super project.

This essentially means that the two modules would have to be in separate repositories, and then in the master repository you git submodule init git://foo.com/assemblebot.git.

I'm not sure that this is worth the effort overall. It's not one of git's strong points (in fact it's the only thing I think needs improvement).

Better support for partial checkouts is in the works (narrow and sparse clones).

Edit: Considering that vpl and assemblebot depend on include and source, perhaps it's better to have include and source as submodules of the vpl and assemblebot repositories. However, these aren't separate projects, and what git does is track project content. I don't see a reason why these modules should actually be separated. Maybe just tell the developers not to touch the other's code?

sebnow
"Maybe just tell the developers not to touch the other's code?" I wish I could tell my boss that ;). Any ways his concerns are genuine. Thanks for the pointer to submodule.
Ankur Gupta
We have a simple policy at work: We don't use tools to enforce management rules. If we don't want people to do things, we tell them not to. If they go ahead and do them anyway, then that's a pretty serious issue, not something to leave up to permission bits in software.
emk