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, 17:29 UTC
Message-ID
<CAE1pOi1KnvRk4yxK8OQHi9h_ueNnh5Ar3tbKFBKTA69=Aje0TQ@mail.gmail.com>
In-Reply-To
<nng3983phhc.fsf@transit.us.cray.com>
On 16 April 2012 13:08,  <dag@cray.com> wrote:
Show 11 quoted lines
> 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.
>
> git-subtree is another option.  It was recently merged into contrib/.
> Whether to use submodules or subtrees largely depends on the work style
> of your group and how coupled the projects are to each other.
> submodules requires a bit more day-to-day maintenance by the user (in my
> experience) while with subtrees it's a bit more involved to push changes
> from the combined repository back to the separate repositories.

(My reply below is based on my experience with Git and submodules from about a year ago. I would really like to see better support for including separate repos in Git. It does not appear to be an easy nut to crack, though.)

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. It's fragile and hard to keep the submodules in synch with each other and the umbrella project. Another problem is branches. 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. I haven't used git-subtree so I can't comment on that. (I do not get the impression that it really is a big step forward, though. I would be *very* happy to be proven wrong, though.)

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.

Previous: dag@cray.comNext: dag@cray.com
Message 4 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.