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

Re: [PATCH 5/5] Add gitmodules(5)

From
JWJosef Weidendorfer <josef.weidendorfer@gmx.de>
Date
Jun 12, 2007, 21:33 UTC
Message-ID
<200706122333.14167.Josef.Weidendorfer@gmx.de>
In-Reply-To
<7vfy4xhu6p.fsf@assigned-by-dhcp.pobox.com>
On Tuesday 12 June 2007, Junio C Hamano wrote:
> Johannes Sixt <J.Sixt@eudaptics.com> writes:
Show 31 quoted lines
> > KDE (superproject)
> >  +- kdelibs (subproject)
> >  |   +- admin (subproject)
> >  |   +- subdir1
> >  |   +- ...
> >  +- kdebase (subproject)
> >  |   +- admin (subproject)
> >  |   +- subdir2
> >  |   +- ...
> >  +- kdenetwork (subproject)
> >  |   +- admin (subproject)
> >  |   +- subdir3
> >  |   +- ...
> >  ...
> 
> If these three instances of 'admin' are truly the same project
> created in multiple places in the directory hierarchy, what is
> the reason that it is not arranged like this instead?
> 
>     KDE
>      +- admin
>      +- kdelibs
>      |   +- subdir1
>      |   +- ...
>      +- kdebase
>      |   +- subdir2
>      |   +- ...
>      +- kdenetwork
>      |   +- subdir3
>      |   +- ...
>      ...
Actually, on the SVN server you have this structure.

KDE applications are put together in groups with other applications of same kind, e.g. kdenetwork contains applications for net access.

Now if you want to work on one KDE application e.g. in kdenetwork, you usually checkout _only_ the kdenetwork directory. There is no need to have other parts; e.g. you usually should be able to use the KDE libs from your distribution - no need to checkout kdelibs.

However, the "admin" directory above contains the build environment, which has to be checked out so that kdenetwork is able to build. The applications expect the build tools to reside in the admin subdirectory.

To checkout admin inside KDE modules such as kdenetwork, SVN externals are used, which is a primitive form of git submodules, to automatically checkout the admin directory on checkout of the KDE module.

So the same admin directory only will be duplicated multiple times only on the developers side where multiple KDE modules are checked out.

> When kdelibs/subdir1 needs to access stuff in admin, instead of
> going to ../admin, it could very well go to ../../admin couldn't
> it?

Usually, ../../admin will not exist as explicit checkout on a developers machine. It would be possible to require this, but it is much nicer to have each checkout of a KDE module self-contained, including a copy of admin.

> It makes me wonder if the KDE's layout you quoted is a good
> practice we would want to recommend for other people to follow.
> If not, I doubt it is a good idea to model our important concept
> after that layout to begin with.

In the case of KDE, as far as I remember there is no need to put _everything_ inside of a the mega supermodule. Every KDE module (like kdelibs, kdebase, kdenetwork) has its own configure run and checks dependencies.

What IMHO is an important use case for submodules is to have the same submodule in multiple different superprojects, as the admin example shows.

Josef
PS: Above admin example is from KDE3. KDE4 uses an
installed build environment (not really sure).
Previous: Sven VerdoolaegeNext: Lars Hjemli
Message 20 of 28 in “misc. submodule related changes”
  1. 0/5 misc. submodule related changesLars Hjemli, Jun 11, 2007
  2. 1/5 t7400: barf if git-submodule removes or replaces a fileLars Hjemli, Jun 11, 2007
  3. 2/5 git-submodule: remember to checkout after cloneLars Hjemli, Jun 11, 2007
  4. 3/5 Rename sections from "module" to "submodule" in .gitmodulesLars Hjemli, Jun 11, 2007
  5. 4/5 git-submodule: give submodules proper namesLars Hjemli, Jun 11, 2007
  6. 5/5 Add gitmodules(5)Lars Hjemli, Jun 11, 2007
  7. Frank LichtenheldJun 11, 2007
  8. 5/5 Add gitmodules(5)Lars Hjemli, Jun 12, 2007
  9. Sven VerdoolaegeJun 12, 2007
  10. Lars HjemliJun 12, 2007
  11. Josef WeidendorferJun 12, 2007
  12. Lars HjemliJun 12, 2007
  13. Josef WeidendorferJun 12, 2007
  14. Sven VerdoolaegeJun 12, 2007
  15. Lars HjemliJun 12, 2007
  16. Johannes SixtJun 12, 2007
  17. Johannes SixtJun 12, 2007
  18. Junio C HamanoJun 12, 2007
  19. Sven VerdoolaegeJun 12, 2007
  20. Josef WeidendorferJun 12, 2007
  21. 5/5 Add gitmodules(5)Lars Hjemli, Jun 12, 2007
  22. Johannes SixtJun 12, 2007
  23. Lars HjemliJun 12, 2007
  24. Josef WeidendorferJun 12, 2007
  25. Lars HjemliJun 12, 2007
  26. Johannes SixtJun 12, 2007
  27. Josef WeidendorferJun 12, 2007
  28. Josef WeidendorferJun 12, 2007

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.