git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Notes on Using Git with Subprojects

From
Shawn Pearce <spearce@spearce.org>
Date
Sep 28, 2006, 00:36 UTC
Message-ID
<20060928003658.GB22593@spearce.org>
In-Reply-To
<451B0F59.6070901@dawes.za.net>
Rogan Dawes <lists@dawes.za.net> wrote:
Show 23 quoted lines
> Shawn Pearce wrote:
> 
> >
> > - Higher level projects should drive subprojects.
> >
> >   Higher level projects tend to be composed of specific revisions or
> >   specific generations of subprojects.
> >
> >   Part of the content of the higher level project is just what
> >   those subproject specifications are and how those subprojects
> >   should appear in a working directory.
> >
> 
> >
> >I used the term "generation of subprojects" as not everyone wants
> >to bind their root project to a specific revision of a subproject.
> >Indeed that may not be entirely practical.  Instead just a particular
> >lineage of development (e.g. "Version 1.0" vs. "Version 1.2")
> >may be all that is needed.
> >
> 
> Does it not make sense that a commit of the higher level project should 
> include the contents of its subprojects at that particular moment in time?

If the subproject is a Git repository we can simply record a commit SHA1 or a tag SHA1 and assuming we can locate the objects for that repository in the future we can fully recover that subproject. No subtree tracking necessary.

If the subproject is an SVN repository we can simply record the branch/tag path and the specific revision number and fully recover that subproject, assuming we have access to the central SVN repository. If we don't or we are concerned about that then we would want to use git-svn/git-svnimport to mirror the SVN repository and treat it as a proper Git subproject.

If the subproject is a Monotone or Darcs project I believe we could also store some small token for a unique directory state of that subproject and recover that from Monotone or Darcs without importing the entire subproject into Git. If you don't trust Monotone or Darcs then maybe you should be importing/mirroring that project into Git. At which point its a proper Git subproject.

If the subproject is CVS then you either need to trust the CVS tag or import the tree into Git. If you are going to import the tree into Git then you might as well just treat the subproject as a proper Git subproject and use some sort of CVS import or mirror to keep that in sync.

Etc...

My basic point here is that a subproject already has its own SCM and if its not Git you probably either are going to convert it to Git via a Git bridge (git-svn anyone?) or you are going to keep it in its "native" SCM as you probably don't want to incur the disk costs of storing it twice (once in its native SCM and once in Git).

So subtree tracking is probably unncessary.
-- 
Shawn.
Previous: Rogan DawesNext: A Large Angry SCM
Message 23 of 39 in “Notes on Using Git with Subprojects”
  1. A Large Angry SCMSep 26, 2006
  2. Johannes SchindelinSep 26, 2006
  3. A Large Angry SCMSep 26, 2006
  4. Johannes SchindelinSep 26, 2006
  5. A Large Angry SCMSep 26, 2006
  6. Daniel BarkalowSep 26, 2006
  7. Shawn PearceSep 26, 2006
  8. A Large Angry SCMSep 26, 2006
  9. Martin WaitzSep 27, 2006
  10. Johannes SchindelinSep 27, 2006
  11. Martin WaitzSep 27, 2006
  12. Johannes SchindelinSep 27, 2006
  13. Sven VerdoolaegeSep 27, 2006
  14. Junio C HamanoSep 27, 2006
  15. Michael S. TsirkinSep 28, 2006
  16. Jeff KingSep 28, 2006
  17. Martin WaitzSep 27, 2006
  18. Johannes SchindelinSep 27, 2006
  19. A Large Angry SCMSep 27, 2006
  20. Johannes SchindelinSep 27, 2006
  21. Shawn PearceSep 27, 2006
  22. Rogan DawesSep 27, 2006
  23. Shawn PearceSep 28, 2006
  24. A Large Angry SCMSep 28, 2006
  25. A Large Angry SCMSep 28, 2006
  26. A Large Angry SCMSep 27, 2006
  27. Jeff KingSep 27, 2006
  28. A Large Angry SCMSep 28, 2006
  29. Jeff KingSep 28, 2006
  30. Shawn PearceSep 28, 2006
  31. Jeff KingSep 28, 2006
  32. Shawn PearceSep 28, 2006
  33. Shawn PearceSep 28, 2006
  34. Johannes SchindelinSep 28, 2006
  35. Martin WaitzSep 28, 2006
  36. A Large Angry SCMSep 28, 2006
  37. Martin WaitzSep 29, 2006
  38. A Large Angry SCMSep 26, 2006
  39. A Large Angry SCMOct 1, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.