Git Subprojects and Rubyforge


I

Intransition

I was thinking about the issue of Rubyforge only supporting a single
git repo per project, and the issue of subprojects with git in
general. While certainly imperfect this idea occurred to me...

Make each subproject it's own git repo inside a master directory which
is also a git repo. Git ignores the .git directory in subdirs (you can
not add these files even if you try explicitly!). But we could trick
it, if we rename the .git directory. So we would have:

superproj/
.git/
subproj1/
.gitsub
subproj2/
.gitsub

When working on a subproject, we first rename .gitsub to .git, do our
work and then when finished rename it back to .gitsub so the master
git repo will track it. It's an added step but could work. At the top
level we just mass commit the whole as needed. Perhaps some porcelain
could be made to automate this procedure?

One caveat, I don't see a way to clone just one subproject --you have
to clone the whole master repo, but that's not the end of the world.
I know it seems crazy to double track the repos, but at least it's
pretty simple and is a generic solution.

Thoughts? Issues?

Thanks.
 
Ad

Advertisements

J

Joel VanderWerf

Intransition said:
I was thinking about the issue of Rubyforge only supporting a single
git repo per project, and the issue of subprojects with git in
general. While certainly imperfect this idea occurred to me...

Make each subproject it's own git repo inside a master directory which
is also a git repo. Git ignores the .git directory in subdirs (you can
not add these files even if you try explicitly!). But we could trick
it, if we rename the .git directory. So we would have:

superproj/
.git/
subproj1/
.gitsub
subproj2/
.gitsub

When working on a subproject, we first rename .gitsub to .git, do our
work and then when finished rename it back to .gitsub so the master
git repo will track it. It's an added step but could work. At the top
level we just mass commit the whole as needed. Perhaps some porcelain
could be made to automate this procedure?

One caveat, I don't see a way to clone just one subproject --you have
to clone the whole master repo, but that's not the end of the world.
I know it seems crazy to double track the repos, but at least it's
pretty simple and is a generic solution.

Thoughts? Issues?

Thanks.

Scary...

Btw, Sourceforge recently added multiple hg repos per project[1] and
plans the same for git. Dunno if rubyforge and sourceforge are similar
enough for their code to help... Not a high priority for me though...

[1]
http://sourceforge.net/apps/wordpress/sourceforge/2009/08/05/mercurial-multiple-repository-support/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top