Subject: Git: Question about specific subtree usage

From: THILLOSEN Andreas <[email-masked]>
Date: Sun, 12 Jan 2014 01:23:24 +0100

Hi,

I have a question about a specific use case for subtrees, but I'm not
sure if is really possible (hence my e-mail, because all my tests failed
so far...)

>>From what I have read, subtrees are used mainly to:
- Import inside a working git repository, other git repositories... it's
a little like a symbolic link pointing to another git repository, but
without the burden (it will be the main working git repository that will
handle the unified history);
- Merge many repositories into a single one (after that, they will be
seen as directories linked to the same history);
- Conversely, dispatch branches in a single repository, to make them
distinct repositories;

And now, here is my use case...

I have a big project, which contains many components (each one having,
for the moment, its own directory and repository):
MainLibrary/
MainLibrary-Tests/
Frontend1/
Frontend1-Tests/
Frontend2/
Frontend2-Tests/

MainLibrary contains the heart of the application; all other components
are linked to it when compiling.
For testing purpose, it must be possible to synchronize each component
independently (checking out MainLibrary at a specific tag level, and
checking out MainLibrary-Tests at another commit level for instance).
This is the important point... Each component must have its own history
line, and I must be able to check it out freely and independently from
the other components.

Here would be my dream... Each component would be managed by a subtree,
but ensure that:

- Components are not be tied to a same common branch... but I'm not sure
if it is possible to manage distinct history lines within a same git
history; after creating orphan branches, it becomes impossible to run
most operations like "check out");
- Any new developer would need only one basic operation to get the full
working material: clone one repo, and it's done (it would be awesome,
because in reality, my project is even bigger than my example). It would
spare us many scripting operations...
- Each component can be checked out at any desired level, and so we get
the sources of multiple components simultaneously (so far, using
subtrees or submodules, I had always the same trouble: I could only get
the sources of one component, which was the last I checked out or
activated).

Having a big shared history for all components may slow down some
operations, but it won't be a big problem for the scope of our project.
So... is my use case possible using git-magic? (I hinted subtrees, but
maybe there are better ways?)
Or must I keep my current methodology (one independant repository per
components... so each new developer must clones zillions of things at
the right place...)

Greetings,

Andreas THILLOSEN.