Git development
 help / color / mirror / Atom feed
From: Bill Lear <rael@zopyra.com>
To: Nick Colgan <nick.colgan@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Projects within projects
Date: Thu, 29 Oct 2009 13:33:51 -0600	[thread overview]
Message-ID: <19177.60959.457301.349805@lisa.zopyra.com> (raw)
In-Reply-To: <ab1d51700910291140ncd80027j4ee9a30637d7bc40@mail.gmail.com>

On Thursday, October 29, 2009 at 14:40:36 (-0400) Nick Colgan writes:
>I'm currently working on a project made up of parts that could each be
>considered a project in itself. I plan on using redmine or trac to
>manage the project. Now I'm trying to figure out how to manage the
>repo(s) for the project.
>
>These are the current options I have in mind:
>
>1. Create a separate repository for each sub-project and manage each
>separately in redmine (separate bug tracker, wiki, etc.)
>
>2. Create a single repository with a subdirectory for each sub-project.
>
>3. Use git submodules or subversion externals to combine options 1 and 2
>by creating a separate repo for each sub-project, then creating a master
>repo with subdirectory for each sub-project that imports from their
>respective repositories.
>
>What's the best way to handle this situation? Are git submodules and/or
>svn externals sufficiently capable of dealing with this?

Let me give you an example of #3.  I write a fair amount in C++ and
have written a reasonably sophisticated makefile system to allow me to
create a new directory in a project, put files in it, link in a master
makefile, cd into the directory and type 'make' and have things build
without me having to edit the makefile --- I don't want to write
makefile rules, etc., I want to write C++ (fill in the blank here).
It basically relies on naming conventions, but it suits me perfectly.
If I name a file test_*.cc or t_*.cc, or tc_*.cc, it is a unit test,
if I name it m_*.cc, or main_*.cc, it is a main program.  Library
inter-dependencies are easy to set up in a central way, blah blah blah
--- the details are not terribly important.

In any case, I created a new project to work on some "real-time"
financial trading algorithms.  I did this by creating a new repository
into which I added a src directory, under which were several other
directories of source code.  At the top level of the new repo, I added
a git submodule 'mk' that contains my makefile system.  I then linked
the master makefile to my source directory makefile and was off
compiling easily.

In this case, I do absolutely reuse my makefile system across multiple
projects.  It is 100% orthogonal, and I have so far found it to be
very useful to use git submodules.

I imagine also if you are building software that is 100% orthogonal
that you would like to reuse in many projects, git submobules is the
way to go.

I read the Git Submodule Tutorial on the Git Wiki and found myself
able to use submodules very easily after that.


bill

      parent reply	other threads:[~2009-10-29 19:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-29 18:40 Projects within projects Nick Colgan
2009-10-29 18:56 ` Avery Pennarun
2009-10-29 19:33 ` Bill Lear [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19177.60959.457301.349805@lisa.zopyra.com \
    --to=rael@zopyra.com \
    --cc=git@vger.kernel.org \
    --cc=nick.colgan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox