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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 15, 2013, 17:50 UTC
Message-ID
<7vvc7nu1hu.fsf@alter.siamese.dyndns.org>
In-Reply-To
<516C21CF.5080705@xiplink.com>
Marc Branchaud <mbranchaud@xiplink.com> writes:
> In general I think it is a mistake to overload "git clone" with the notion of
> adding a submodule.

I agree with that principle, but my understanding is that this effort is not about teaching "git clone" to create a submodule.

Both "git clone" and "git init" already know how to use a directory that is outside the working tree of the newly created repository to store its $GIT_DIR and point at it with .git in the working tree using the gitfile mechanism (their --separate-git-dir option). My understanding is that this "config" is about making that option easier to use when you _know_ any new repository you create with "git clone" or "git init" inside your (toplevel super)project's working tree will become its submodule, as it is more convenient to have their $GIT_DIR inside the .git/modules/$name of the superproject.

After that "clone" or "init" creates a repository, you still have to "add" if you want to make it a submodule to the toplevel.

Show 11 quoted lines
> If I want to *add* something to a repository, I'll use
> some kind of "add" command.  To me "git clone" is not the kind of verb I
> would expect to add something to some distant-parent .git directory.
>
> Instead of mucking around with"git clone" I would much rather see "git add"
> autodetect URLs and do the submodule thing:
>
> 	git add ssh://host/blammo.git
>
> would clone blammo.git into ./blammo/ and set it up as a submodule inside
> $PWD's git repo.

I do not think the addition Ram is envisioning in the patch will prevent you from teaching "add" to do that. An implemention of such an addition indeed would most likely use the same --separate-git-dir mechanism anyway.

Previous: Marc BranchaudNext: Ramkumar Ramachandra
Message 14 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.