Re: tracking submodules out of main directory.
- From
Alexei Sholik <alcosholik@gmail.com>
- Date
- Jun 28, 2011, 10:05 UTC
- Message-ID
- <BANLkTimsfR4LqDAci0Vr+m9uUE_W-7OSAw@mail.gmail.com>
- In-Reply-To
- <7vvcvrw0vn.fsf@alter.siamese.dyndns.org>
On 27 June 2011 22:05, Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> That is what I called "there is no direct way". Wouldn't it be nicer if > the .gitmodules file in the superproject said something like > > [module "project one"] > path = project1 > url = ... > depends = lib1 > [module "lib1"] > path = lib1 > url = ... > > and then "git submodule init project1" run by the end user implied running > also "git submodule init lib1"?
This is a very nice idea. In my workflow, I find it that I more often need to clone a repo _including_ its submodules, because the top-level project won't compile without them. If we had a way to specify dependencies on submodules, `git pull` could automatically init and update them.
If a user really wants to clone only the top-level repo without submodules, git could provide him with an option for `git pull` (like `git pull --shallow`) to do just that. I think this second scenario is less common, so it is more reasonable to have a '--shallow' option for it, instead of '--recursive' counterpart.
-- Best regards, Alexei Sholik