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

Re: organizing multiple repositories with dependencies

From
HWHilco Wijbenga <hilco.wijbenga@gmail.com>
Date
Apr 17, 2012, 19:55 UTC
Message-ID
<CAE1pOi29dKd2LHW7MJ+TTN4HzFkOPFEyf7Sf2emSsBYm93uYUA@mail.gmail.com>
In-Reply-To
<201204171837.q3HIbbcW013784@no.baka.org>
On 17 April 2012 11:37, Seth Robertson <in-gitvger@baka.org> wrote:
Show 40 quoted lines
> In message <CAE1pOi1KnvRk4yxK8OQHi9h_ueNnh5Ar3tbKFBKTA69=Aje0TQ@mail.gmail.com>, Hilco Wijbenga writes:
>
>    On 16 April 2012 13:08,  <dag@cray.com> wrote:
>    > Jakub Narebski <jnareb@gmail.com> writes:
>    >> Put reusable library in its own repository, and use submodules to link
>    >> it up to project-a and project-b repositories.
>
>    If you really have only one or two libraries then submodules will work
>    just fine but if you have quite a few (we had around 50 when we moved
>    away from submodules) you will find it pretty much unworkable. [...]
>    Branches are per submodule but you want them for all
>    submodules. You might want to look into git-slave if you want to
>    go this route.
>
>    In general, I do not think the blanket statement "one repo per
>    project" is good advice. If projects depend on each other they should
>    be in the same repo. At least with the current support in GIt for
>    including separate projects. Please note that I'm not disagreeing with
>    the notion "one repo per project" itself. It's just not supported well
>    enough to be feasible if you have a fairly large group of projects
>    that depend on each other.
>
> As you mentioned, this is exactly the environment that gitslave was
> designed for.  It provides the flexibility to work on the subprojects
> as if they were standalone independent git repositories (which of
> course they are) or treat the entire superproject as one giant git
> repository (with only a few cracks showing through).  All gitslave
> commands are just git commands (s/^git\s/gits /) so training to use it is
> rather easy.
>
> Unlike with git-submodules there is no strict binding between the
> parent repo's commits and the sub-project's commits except at tag
> boundaries.  This gives you the flexibility of person A saying that A
> is master and B is underneath it while person B says that B is master
> and A is underneath it (or alternatively you can also say that A
> include B plus whatever B includes).  However, I would in general
> recommend that the common library be factored out and be a child of A
> and B.  gitslave makes it trivial to work with federated git
> repositories, if you can handle only having binding between
> repositories at tag boundaries.

Well, since I seem to have pretty much everyone who is involved with "subprojects" (be it submodules, subtree, or gitslave) in this thread, I wanted to clarify what I meant with "not supported well in Git". To me, subproject support is one of the most important pieces missing in Git. Git submodules, subtree and gitslave all provide a part of what I'm looking for: non-invasive subproject support. I would like to be able to use normal Git commands on the umbrella project that "trickle down" to the subprojects. If you work on a subproject (in its own repo) then a subsequent pull in the umbrella project should bring this new code into the umbrella project (assuming that would make sense given the branches involved).

After rereading my earlier reply I felt that it might be interpreted as being disparaging of submodules/subtree/gitslave. I just wanted to make clear that that was not my intent. I'm hopeful that we can get some sort of combination of submodules, subtree and gitslave to provide subproject support in Git.

Previous: Seth RobertsonNext: dag@cray.com
Message 7 of 34 in “organizing multiple repositories with dependencies”
  1. Namit BhallaApr 16, 2012
  2. Jakub NarebskiApr 16, 2012
  3. dag@cray.comApr 16, 2012
  4. Hilco WijbengaApr 17, 2012
  5. dag@cray.comApr 17, 2012
  6. Seth RobertsonApr 17, 2012
  7. Hilco WijbengaApr 17, 2012
  8. dag@cray.comApr 17, 2012
  9. Hilco WijbengaApr 17, 2012
  10. PJ WeisbergApr 17, 2012
  11. Hilco WijbengaApr 17, 2012
  12. Namit BhallaApr 18, 2012
  13. Jens LehmannApr 18, 2012
  14. dag@cray.comApr 24, 2012
  15. Hilco WijbengaApr 24, 2012
  16. PJ WeisbergApr 24, 2012
  17. Hilco WijbengaApr 24, 2012
  18. dag@cray.comApr 24, 2012
  19. Phil HordApr 30, 2012
  20. dag@cray.comApr 30, 2012
  21. Jens LehmannApr 18, 2012
  22. dag@cray.comApr 24, 2012
  23. Seth RobertsonApr 24, 2012
  24. Jens LehmannApr 24, 2012
  25. Seth RobertsonApr 24, 2012
  26. dag@cray.comApr 24, 2012
  27. username localhostApr 28, 2012
  28. dag@cray.comApr 24, 2012
  29. Seth RobertsonApr 25, 2012
  30. dag@cray.comApr 27, 2012
  31. Eugene SajineApr 24, 2012
  32. Hilco WijbengaApr 24, 2012
  33. dag@cray.comApr 24, 2012
  34. dag@cray.comApr 24, 2012

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.