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

Re: [RFC/PATCH] clone: introduce clone.submoduleGitDir to relocate $GITDIR

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Apr 16, 2013, 08:36 UTC
Message-ID
<CALkWK0kDgSicNejydLsH6iqj-yDYGz6CKd+kbn4EW1HxgAxsBA@mail.gmail.com>
In-Reply-To
<20130416025840.GH3262@elie.Belkin>
Jonathan Nieder wrote:
> I quite like .git/modules/<subproject name> (for some reasons that
> I've mentioned in other threads) and don't consider it nonsense, which
> makes me assume I don't understand the goal of this patch, either.
> Please don't take that personally.

There's nothing to take personally, Jonathan. We're designing software, and the rationale for choosing a design is never "Jonathan personally likes this particular design, so therefore we'll go with it", but rather "Ram's design is objectively superior, and therefore we'll go with it". I'll proceed with bashing .git/modules, while your job is to defend it:

1. The path to the object store of a submodule depends upon how deeply
it is nested in other submodules, and hence how many /modules/
components to add to the path to the project's name.  Presumably, this
is to avoid conflicts: but it's an overkill for such a simple job.  In
the 98% case, I never have two submodules with the same name in my
superproject; for the 2% case, I can live with the inconvenience of
naming a directory by hand, rather than putting up with this ugliness.
2. This ugliness complicates implementation of add/ rm/ mv, because
each of them will have to know about this contrived path solution.
3. The paths in the gitfiles in various submodules is horribly ugly
with tons of ../ components.  This is especially the case in deeply
nested submodules.  We can't use an absolute path, because the
superproject directory can be moved anywhere in the filesystem.
4. To relocate the object store and reuse it elsewhere is almost
impossible.  What if I want to remove the submodule, but work on it
independently from the superproject?  Re-clone?

My solution fixes all these problems, and we need .git/modules/<name>.git (no path-to-submodule nonsense) only as a last resort: #3 (ref: my email to Peff).

Previous: Jonathan NiederNext: Junio C Hamano
Message 31 of 41 in “clone: introduce clone.submoduleGitDir to relocate $GITDIR”
  1. clone: introduce clone.submoduleGitDir to relocate $GITDIRRamkumar Ramachandra, Apr 13, 2013
  2. Junio C HamanoApr 15, 2013
  3. Junio C HamanoApr 15, 2013
  4. Ramkumar RamachandraApr 15, 2013
  5. Junio C HamanoApr 15, 2013
  6. Ramkumar RamachandraApr 15, 2013
  7. Ramkumar RamachandraApr 15, 2013
  8. Ramkumar RamachandraApr 15, 2013
  9. Duy NguyenApr 15, 2013
  10. Ramkumar RamachandraApr 15, 2013
  11. Junio C HamanoApr 15, 2013
  12. Ramkumar RamachandraApr 15, 2013
  13. Marc BranchaudApr 15, 2013
  14. Junio C HamanoApr 15, 2013
  15. Ramkumar RamachandraApr 15, 2013
  16. Jeff KingApr 15, 2013
  17. Junio C HamanoApr 15, 2013
  18. Ramkumar RamachandraApr 16, 2013
  19. Marc BranchaudApr 16, 2013
  20. Marc BranchaudApr 15, 2013
  21. Ramkumar RamachandraApr 16, 2013
  22. Marc BranchaudApr 16, 2013
  23. Marc BranchaudApr 15, 2013
  24. Junio C HamanoApr 15, 2013
  25. Marc BranchaudApr 15, 2013
  26. Junio C HamanoApr 15, 2013
  27. Ramkumar RamachandraApr 16, 2013
  28. Marc BranchaudApr 16, 2013
  29. Ramkumar RamachandraApr 15, 2013
  30. Jonathan NiederApr 16, 2013
  31. Ramkumar RamachandraApr 16, 2013
  32. Junio C HamanoApr 16, 2013
  33. Jonathan NiederApr 17, 2013
  34. Duy NguyenApr 17, 2013
  35. Ramkumar RamachandraApr 17, 2013
  36. Duy NguyenApr 17, 2013
  37. Ramkumar RamachandraApr 17, 2013
  38. Duy NguyenApr 17, 2013
  39. Ramkumar RamachandraApr 17, 2013
  40. Duy NguyenApr 17, 2013
  41. Junio C HamanoApr 17, 2013

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.