Chris Cleeland writes:

> I'm looking at possibly using gitorious inside a corporate environment, and
> am finding it difficult to figure out how use the project/repository
> hierarchy to reflect what we really do/need.
>
> Suppose we map the gitorious "project" concept to the notion of a
> "product".  The product consists of multiple subsystems, and we map a
> subsystem to a gitorious "repository".
>
> Now, suppose that we define another product, so we create a new "project".
>  Some of that product's subsystems will be unique to the product, but, if
> we do a good job at re-use, some of the subsystems from the first product
> can also be re-used.  How do I use the same repository in both project A
> and project B?

Short answer: you can't. The project entity in Gitorious is a collection
of:
- repositories
- committers
- a wiki

There's a one-to-one mapping between a project and a repository, and a
project is basically a collection of (unique) repositories.

> Now, if I can't share repositories across projects, what are my
> alternatives?  Do I need to "promote" a shared repository out of project A
> into its own project?  If that's the case, how do I set up the dependencies
> between project A and project SharedComponent and, similarly, between
> project B and project SharedComponent?

You could use git submodules for this, or use some kind of
packaging/dependency management tool to require a given version of a
component in other repositories - it depends on the
language/infrastructure your code uses I suppose.

A specific example of how the Gitorious team does this is the code
browser in Gitorious 3, which is also used in the standalone Dolt tool
(http://git.zmalltalker.com/dolt.git/tree/master:). Both the Gitorious
mainline repository and the Dolt repository (which are both in the
Gitorious project) use the libdolt tool (which is also part
of the Gitorious project.

In the initial development of libdolt we used a git submodule for
libdolt inside Dolt and Gitorious, but as soon as the API for libdolt
became more or less stable we published libdolt as a separate package
(Ruby uses rubygems for packaging) and added libdolt as a requirement in
Gitorious and Dolt. When requiring libdolt from these projects we depend
on a specific version of libdolt
(http://git.zmalltalker.com/dolt.git/blob/master:dolt.gemspec) so we can
change the API in libdolt without breaking projects depending on
it. For Java-based projects you'd probably use maven to achieve
something similar.

An alternative to these approaches could be to use a "git meta tool"
like the Android project's repo tool
(http://source.android.com/source/using-repo.html) which uses a separate
manifest repository to group repositories forming a product.

> Finally, I've yet to find any kind of document/wiki/blog/etc. that
> discusses this aspect of gitorious.  Have I missed it?  I am happy to RTFM
> if someone can point me towards TFM.

:-) I'll probably be adding this to the documentation at
http://getgitorious.com/documentation/index.html.

Does this make sense?

Cheers,
- Marius

-- 
-- 
To post to this group, send email to gitorious@googlegroups.com
To unsubscribe from this group, send email to
gitorious+unsubscr...@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"Gitorious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitorious+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to