From: Jens Lehmann <Jens.Lehmann@web.de>
To: Lauri Alanko <la@iki.fi>
Cc: git@vger.kernel.org
Subject: Re: A design for subrepositories
Date: Sun, 14 Oct 2012 15:28:19 +0200 [thread overview]
Message-ID: <507ABDF3.4040106@web.de> (raw)
In-Reply-To: <20121014131928.25943ezwa6fveyls.lealanko@webmail.helsinki.fi>
Am 14.10.2012 12:19, schrieb Lauri Alanko:
> Quoting "Junio C Hamano" <gitster@pobox.com>:
>
>>> If the
>>> submodules ever get reorganized and foo is moved to ./bar, then it is
>>> impossible to check out older versions or alternate branches, since
>>> the submodule is no longer where it is expected to be at the origin.
>>
>> Isn't that exactly what the "module name" vs "module path" mapping
>> in .gitmodules file is meant to address?
>
> Yes, and as I showed after the part you quoted, it is possible to refer to a module by name, although it looks like such a hack that I can't imagine it's currently something that git-submodule is intended to support.
Your initial statement is not correct. It is possible to check out older
versions or alternate branches (at least since we moved the .git directory
into the .git directory of the superproject). So no improvement gained
here by your proposal (although I concede that the current user experience
is suboptimal until my recursive submodule update work hits mainline).
>>> But still, "git submodule update" only looks at the modules in the
>>> currently checked-out tree. If we have other branches or old tags that
>>> refer to other submodules, there's no simple way to fetch those, too.
Did you notice that "git fetch" fetches all those submodules too which
have been updated in the commits fetched for the superproject, no matter
on what branch they are on?
>> Didn't I already suggest you to think about how you can improve
>> existing "git submodule" to suit your use case better?
>
> Yes, and I listed three possible ways. Two of them seem technically unattractive, whereas one of them (submodules as ref directories) seems like a huge change that could introduce incompatibilities. That is why a separate tool seems like a cleaner choice.
What's wrong with making git clone all submodules together with the
superproject (when the user said he wants to update all submodules on
clone too by setting a - still to be added - config option)? That's my
plan to make automagic recursive submodule cloning work and it would
clone all submodules seen in the history of the superproject to
.git/modules so they could easily be checked out later (and those
present in the HEAD of the superproject will be checked out immediately
like "git clone --recurse-submodules" does right now). Were not there
yet, but that's how I believe that should work.
> There is actually a fourth alternative: extend the git protocol so that a remote repository could be queried for its list of submodules.
That information is contained in the different versions of the .gitmodules
file, so no need to extend anything here.
I saw nothing in your proposal which couldn't been handled by submodules,
and for every issue there already have been proposals on how to do that.
So adding another tool doesn't make any sense here. But you are welcome
helping us to improve the submodule script (and some core commands too)
to make submodules cover your use case too.
next prev parent reply other threads:[~2012-10-14 13:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-13 13:33 A design for subrepositories Lauri Alanko
2012-10-13 17:30 ` Junio C Hamano
2012-10-13 21:23 ` Lauri Alanko
2012-10-14 4:36 ` Junio C Hamano
2012-10-14 10:19 ` Lauri Alanko
2012-10-14 13:28 ` Jens Lehmann [this message]
2012-10-14 15:27 ` Lauri Alanko
2012-10-14 16:10 ` Jens Lehmann
2012-10-14 16:15 ` Jens Lehmann
2012-10-14 16:25 ` Jens Lehmann
2012-10-14 18:04 ` Junio C Hamano
2012-10-14 19:32 ` Jens Lehmann
2012-10-19 0:31 ` A design for distributed submodules Lauri Alanko
2012-10-19 20:09 ` Jens Lehmann
2012-10-14 22:59 ` A design for subrepositories Lauri Alanko
2012-10-15 17:10 ` Jens Lehmann
2012-10-13 21:20 ` perryh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=507ABDF3.4040106@web.de \
--to=jens.lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=la@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).