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

Re: Re: Relative submodule URLs

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Aug 28, 2014, 19:35 UTC
Message-ID
<20140828193533.GA20040@book.hvoigt.net>
In-Reply-To
<53FF6A72.50605@xiplink.com>
On Thu, Aug 28, 2014 at 01:44:18PM -0400, Marc Branchaud wrote:
Show 29 quoted lines
> Heiko also said this:
> > On Fri, Aug 22, 2014 at 12:00:07PM -0400, Marc Branchaud wrote:
> >> With relative-path submodules, the push's target repo *must* also have the
> >> submodules in their proper places, so that they can get updated.
> >> Furthermore, if you clone a repo that has relative-path submodules you
> >> *must* also clone the submodules.
> >
> > That is not true. You can have relative submodules and just clone/fetch
> > some from a different remote. Its just a question of how to
> > specifiy/transport this information.
> 
> I meant that more as a general guideline than some kind of physical law.
> Sure, it's possible to scatter the submodules across all sorts of hosts, but
> it's not a good idea.  When it comes to relative-path submodules, pushing and
> fetching submodule changes in the super-repo should just involve the one
> remote host (whatever way that's determined).  This keeps things tractable,
> because otherwise your branch's changes are scattered among many different
> hosts and you end up considering weird things like "this part of the branch's
> changes are on host A but this other part are on host B, so let's record that
> somewhere, oh but what if host B is down when I'm trying to fetch, but I know
> that host C has the changes too so why don't I just fetch what I want from
> there".
> 
> It's a nightmare.  It's infinitely better to treat a repository and its
> relative-path submodules as an atomic unit, so that any remote that hosts the
> repository also hosts the submodules.  When pushing a branch with submodule
> changes, expect to find those submodules on the target remote and update
> them.  Regardless of how the target remote is determined.  Same thing for
> fetching.  It's just so much simpler to work this way.

You are right, its simpler. But I would not say "better". Depending on your project it might be "better" to just fork some submodules.

> So please, let's not try to specify submodule remotes per-branch or make that
> info pushable.  It's enough for a branch's local configuration to say that it
> tracks fetch/pull refs on different remotes.  The rest should flow from that.

Why not? Git is all about flexibility. Of course if you organise your submodules in chaos you will get chaos. But consider this:

You have this big project which consists of submodule (e.g. like Android with hundreds of submodules). Now you want to develop on something that involves just a subset of submodules, lets say two submodules.

Now if someone just wants to publish a small change to some submodules you are demanding to setup a mirror of *all* submodules that are in this big project. That might not even be feasible depending on the projects size and the remote quota. Not to speak about having to first create a fork of hundreds of repositories. So in this situation we should support just referring some submodules to other places.

Regarding transporting this information. If you ask someone to try out your change it should be as simple as possible. It should be enough to say. clone from there and checkout that branch (once recursive checkout and fetch for submodules is in place). So here we need a way to transport this configuration for a fork.

Yes for a small project where its feasible to simply clone all submodules you can just say: please fork everything. But for bigger projects thats not necessarily an option. So we should at least give the users that option. Then its a matter of policy how you work with a project.

I am not saying that everything for this should be implemented in the first steps but we should keep it in mind and design everything in such a way that it is still possible to implement such a kind of workflow later.

Cheers Heiko
Previous: Marc BranchaudNext: Marc Branchaud
Message 24 of 25 in “Relative submodule URLs”
  1. Robert DaileyAug 18, 2014
  2. Jonathan NiederAug 18, 2014
  3. Heiko VoigtAug 19, 2014
  4. Robert DaileyAug 19, 2014
  5. Junio C HamanoAug 19, 2014
  6. Robert DaileyAug 19, 2014
  7. Junio C HamanoAug 19, 2014
  8. Robert DaileyAug 19, 2014
  9. Heiko VoigtAug 19, 2014
  10. Robert DaileyAug 19, 2014
  11. Heiko VoigtAug 19, 2014
  12. Robert DaileyAug 20, 2014
  13. Heiko VoigtAug 21, 2014
  14. Robert DaileyAug 19, 2014
  15. Marc BranchaudAug 22, 2014
  16. Heiko VoigtAug 24, 2014
  17. Robert DaileyAug 25, 2014
  18. Robert DaileyAug 25, 2014
  19. Heiko VoigtAug 26, 2014
  20. Robert DaileyAug 26, 2014
  21. Heiko VoigtAug 26, 2014
  22. Robert DaileyAug 25, 2014
  23. Marc BranchaudAug 28, 2014
  24. Heiko VoigtAug 28, 2014
  25. Marc BranchaudAug 29, 2014

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.