Project organisation and structure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,
I'm new to git, and I hope this is the right mailinglist for what I'm
going to ask; it was the only one I found on http://git.or.cz. Sorry
if it's not or my question is remarkably stupid. I've read the git
documentation, of course, but it wasn't always easy to wrap my head
around all the concepts, so I might have missed an obvious solution to
my problem.

Currently, I've got a tree of self-written C++ source code for which I
don't use any SCM, and I'd like to start using git on it. However,
I've run into issues with my directory layout I cannot resolve on my
own.
I have a collection of libraries and programs, which aren't coupled
too much, but aren't really independent either; for example, library X
depends on Y, program Z on lib A and so forth. Since all of these libs
and programs are logically connected to each other in some way, I
would like to have them all in one central repository.
So I heard that I could create kind of a "meta-repository" for the
whole project, and have submodules for each library or program, which
sounds exactly like what I want. However, I've been told that my
current directory layout will not work this way with git.

This is how my project root directory (say it's ~) looks like:
~/build - Build files which apply for the whole project, like doxygen
build files.
~/include/$submodule - Each library/program has an own directory here,
in which all header files go.
~/projects/$submodule - Files related to an individual project, like
makefiles etc.
~/src/$submodule - Like the above two, but for source files.
~/test/$submodule - Again, a directory for each library/program,
containing files for (unit)tests.
~/doc - Documentation files for the project as a whole.
~/doc/$submodule - Documentation files for individual libraries/programs.

These are the directories I would like git to track for me. There are
some other dirs not listed here (e.g. for object files,) but I can
easily add them to .gitignore.

So, the git structure as I imagine it would look like this: ~/.git
contains the "meta-repository," in which all the submodules reside.
Each submodule would have its .git directory in ~/projects/$submodule.
Alternatively, ~/.git for the meta-repo and ~/.git-$subproject or
something like this would be okay too.

However, I have been told I cannot go to ~/projects/$submodule and do
a "git add ../../{include,src,test,doc}/$submodule" there. I could add
symlinks in ~/projects/$submodule to each of these dirs and add that
link, but this would not work with windows, I guess (would it work
with git, anyway?)

So, how can I manage my code without having to restructure my tree?

I'd like to keep it that way, because it is convenient to have only
one directory to pass to the compiler as an additional include dir,
and can include my header files as "submodule/someheader.hpp" which
is, in my opinion, helpful in organizing the code.

If there should be no way I can keep my directory setup the way it is
with the current git, would a feature request be a good idea (and
possibly implemented), or does my directory tree have a serious flaw I
haven't stumbled across yet, which makes it unusable anyways?

Thank you in advance.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux