git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Ericsson <ae@op5.se>
To: John Dlugosz <JDlugosz@TradeStation.com>
Cc: git@vger.kernel.org
Subject: Re: Project With Reusable Libraries
Date: Wed, 25 Mar 2009 09:13:39 +0100	[thread overview]
Message-ID: <49C9E7B3.2090206@op5.se> (raw)
In-Reply-To: <450196A1AAAE4B42A00A8B27A59278E70A5597A8@EXCHANGE.trad.tradestation.com>

John Dlugosz wrote:
> Consider a directory tree something like this:
> 
> 	...
> 	foo\
> 	  bar\
> 	   project-root\
> 	     app1\
> 	         contents of app1
> 	     app2\
> 	         contents of app2
> 	     lib1\
> 	         contents of library 1
> 	     lib2\
> 	         contents of library 2
> 
> 
> Each project, whether application or library, has its own git repository
> already.  A program, say app1, is now dependant on the libraries.  The
> libraries are meant to be used in multiple applications.
> 
> This is not like what is described under subprojects, since the libs are
> not "under" the application, but are peers in the directory structure.
> It would be wrong to put lib1 and lib2 as subdirectories of app1 because
> they are also used by app2, right?
> 
> Then again... if app1 and app2 are not always built as part of the same
> set, they might have different versions of the libs specified.  I
> understand that the newer versions of msysgit do hard linking so having
> multiple repositories for the same thing won't waste disk space, but
> still requires fetching to keep them in sync?
> 
> Anyway, how would you do it?
> 

If app1 and app2 requires different versions of the same library, I'd
make them separate git projects entirely.

If they have to stay in the same project, I'd put their respective
libraries as a submodule under each app. You could get away without
having to fetch them if you stash the lib projects in the super
project and then link the app project's lib-submodules to the one
in the super-project, but it gets messy when you try to explain
that without some simple means of drawing things, so if you can't
write a "sync-submodules" script, I guess it's not really worth
the problem. Especially if the lib-repositories aren't huge.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

      reply	other threads:[~2009-03-25  8:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-24 16:40 Project With Reusable Libraries John Dlugosz
2009-03-25  8:13 ` Andreas Ericsson [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=49C9E7B3.2090206@op5.se \
    --to=ae@op5.se \
    --cc=JDlugosz@TradeStation.com \
    --cc=git@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).