Re: [RFC] Submodules in GIT

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Martin Waitz
Date: Friday, December 1, 2006 - 4:00 am

hoi :)

On Fri, Dec 01, 2006 at 09:02:48AM +0000, Andy Parkins wrote:

exactly!

Please think about it.

If you track HEAD, then this means that you track HEAD.
In _both_ directions!

So you not only store your submodule HEAD commit in the supermodule when you
do commit to the supermodule, it also means that your submodule HEAD
will be updated when you update your supermodule.
And what happens if you already commited something to HEAD in the mean
time? Exactly: a merge is needed.

And you are right: you might not want to do this now, because you
branched off, because you _wanted_ to have some development which is
_independent_ to the current supermodule work.

So tracking HEAD really makes branching in the submodule hard to work
with.

What does the supermodule provide to the submodule? It stores one
reference to a commit sha1. Just like a reference inside refs/heads
inside the submodule. There really is not much difference between the
sha1 stored inside the supermodules tree and one stored inside refs/.
So from the submodules point of view, the supermodule is not much more
then one special branch.
But it is not possible to use the supermodule index directly as one
"magic" branch for several reasons.
So we need synchronization methods between the index entry for the
submodule which is stored in the supermodule and the references in the
submodule. These are git-update-index/git-commit and git-checkout, both
called explicitly or implicitly in the supermodule.
And I really think it makes sense to have a one-to-one relationship
between the submodule "branch" stored in the supermodule and the
branchname used in the submodule.

ch=20
of=20
=20

I don't see your problem here.

e. =20
=20

This is still supposed to be a distributed system.
DeveloperB does not only check out the whole project including several
modules. He is also supposed to _work_ with it.

What if DeveloperB also has several topic branches?
When he checks out the new supermodule, only his current HEAD in the
submodule will be updated.
So he first has to change to some supermodule-tracking branch inside the
submodule, then pull the supermodule updates, then eventually merge the
new contents of his supermodule-tracking branch into his topic branches.
So why not make this "let's update one supermodule-tracking-branch"
automatic?


So what? He can do to the repository whatever he wants?
He wants to change one submodule to a different branch?
He can do so!
But please do not expect the system to magically be able to resolve
problems. If you _by intent_ changed the submodule to another branch
which is incompatible to the one used in the submodule you can't expect
that this is magically merged.
This is the same as with normal files.
Sure you can replace one file with new contents that are different to
the one used by someone else.  Don't expect this can be merged
automatically. So now you have two forks/branches of the project.
So what?

Same for a system including submodules:
If you change one submodule to a totally different branch, then you
effectivley forked/branched the entire project.
(Nomenclature is a bit difficult here: what I mean by totally different
branch is: the submodule commit tracked by the supermodule is not
directly connected to the one tracked by an old version of the
supermodule).

So whenever you introduce conflicting changes somewhere in the project
(be it in a submodule or in a file) you _always_ fork/branch the entire
project (i.e. the topmost supermodule).
You can't circumvent that.

So what are submodule branches good for then?
To store other lines of development which are not yet / not any more
tracked by the supermodule.  Perhaps you store references to branches
stored in another supermodule, or another standalone repository.
Or a temporary branch which is only used for testing.
There are really many possiblilities.
But they all have one thing in common: they are not meant to be tracked
by the supermodule.


Yes, but a submodule is special here: it really has one special branch.
The module is not independent any more.  That is the _nature_ of a
submodule.


Sure, we are in a distributed system.
But the supermodule always has to know which branch in the submodule has
to be tracked.  The easiest thing is to always use the default
refs/heads/master.  Surely this could be changed if there is a need.

--=20
Martin Waitz
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [RFC] Submodules in GIT, Jakub Narebski, (Tue Nov 28, 3:50 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Tue Nov 28, 6:35 am)
Re: [RFC] Submodules in GIT, Shawn Pearce, (Tue Nov 28, 8:44 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Tue Nov 28, 9:29 am)
Re: [RFC] Submodules in GIT, Shawn Pearce, (Tue Nov 28, 9:36 am)
Re: [RFC] Submodules in GIT, Jon Loeliger, (Tue Nov 28, 10:38 am)
Re: [RFC] Submodules in GIT, Steven Grimm, (Tue Nov 28, 12:58 pm)
Re: [RFC] Submodules in GIT, Shawn Pearce, (Tue Nov 28, 2:02 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Wed Nov 29, 9:03 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Wed Nov 29, 9:15 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Wed Nov 29, 1:00 pm)
Re: [RFC] Submodules in GIT, sf, (Thu Nov 30, 4:57 am)
Re: [RFC] Submodules in GIT, Andreas Ericsson, (Thu Nov 30, 5:16 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Thu Nov 30, 5:40 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Thu Nov 30, 10:06 am)
Re: [RFC] Submodules in GIT, Andreas Ericsson, (Thu Nov 30, 11:57 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Fri Dec 1, 1:49 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Fri Dec 1, 2:02 am)
Re: [RFC] Submodules in GIT, Andreas Ericsson, (Fri Dec 1, 2:33 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Fri Dec 1, 3:38 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 4:00 am)
Re: [RFC] Submodules in GIT, sf, (Fri Dec 1, 5:03 am)
Re: [RFC] Submodules in GIT, sf, (Fri Dec 1, 5:09 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 5:11 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 5:12 am)
Re: [RFC] Submodules in GIT, sf, (Fri Dec 1, 6:05 am)
Re: [RFC] Submodules in GIT, sf, (Fri Dec 1, 6:21 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 6:35 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 6:43 am)
Re: [RFC] Submodules in GIT, Andreas Ericsson, (Fri Dec 1, 6:43 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 6:46 am)
Re: [RFC] Submodules in GIT, Stephan Feder, (Fri Dec 1, 6:51 am)
Re: [RFC] Submodules in GIT, Stephan Feder, (Fri Dec 1, 7:23 am)
Re: [RFC] Submodules in GIT, Andreas Ericsson, (Fri Dec 1, 7:52 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 7:58 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 8:00 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 8:07 am)
Re: [RFC] Submodules in GIT, Stephan Feder, (Fri Dec 1, 8:47 am)
Re: [RFC] Submodules in GIT, Stephan Feder, (Fri Dec 1, 9:04 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 9:15 am)
Re: [RFC] Submodules in GIT, Andreas Ericsson, (Fri Dec 1, 9:38 am)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Fri Dec 1, 9:49 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 9:54 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 9:57 am)
Re: [RFC] Submodules in GIT, sf, (Fri Dec 1, 10:08 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 10:14 am)
Re: [RFC] Submodules in GIT, Stephan Feder, (Fri Dec 1, 10:33 am)
Re: [RFC] Submodules in GIT, Andreas Ericsson, (Fri Dec 1, 11:06 am)
Re: [RFC] Submodules in GIT, Andreas Ericsson, (Fri Dec 1, 11:08 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 11:48 am)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 11:51 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Fri Dec 1, 12:17 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 12:38 pm)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Fri Dec 1, 1:13 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 1:30 pm)
Re: [RFC] Submodules in GIT, Andy Parkins, (Fri Dec 1, 2:04 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 2:37 pm)
Re: [RFC] Submodules in GIT, Andy Parkins, (Fri Dec 1, 2:54 pm)
Re: [RFC] Submodules in GIT, Josef Weidendorfer, (Fri Dec 1, 3:06 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 3:08 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 3:12 pm)
Re: [RFC] Submodules in GIT, Josef Weidendorfer, (Fri Dec 1, 3:26 pm)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Fri Dec 1, 3:26 pm)
Re: [RFC] Submodules in GIT, sf, (Fri Dec 1, 3:35 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 3:40 pm)
Re: [RFC] Submodules in GIT, sf, (Fri Dec 1, 3:41 pm)
Re: [RFC] Submodules in GIT, Josef Weidendorfer, (Fri Dec 1, 3:55 pm)
Re: [RFC] Submodules in GIT, Josef Weidendorfer, (Fri Dec 1, 4:03 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Fri Dec 1, 4:07 pm)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Fri Dec 1, 4:09 pm)
Re: [RFC] Submodules in GIT, Josef Weidendorfer, (Fri Dec 1, 4:17 pm)
Re: [RFC] Submodules in GIT, Alan Chandler, (Fri Dec 1, 4:23 pm)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Fri Dec 1, 4:30 pm)
Re: [RFC] Submodules in GIT, sf, (Fri Dec 1, 4:34 pm)
Re: [RFC] Submodules in GIT, Josef Weidendorfer, (Fri Dec 1, 4:36 pm)
Re: [RFC] Submodules in GIT, sf, (Fri Dec 1, 4:49 pm)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Fri Dec 1, 5:12 pm)
Re: [RFC] Submodules in GIT, Josef Weidendorfer, (Fri Dec 1, 5:14 pm)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Fri Dec 1, 5:33 pm)
Re: [RFC] Submodules in GIT, Andy Parkins, (Sat Dec 2, 2:22 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Sat Dec 2, 2:27 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Sat Dec 2, 3:04 am)
Re: [RFC] Submodules in GIT, Josef Weidendorfer, (Sat Dec 2, 4:32 am)
Re: [RFC] Submodules in GIT, Josef Weidendorfer, (Sat Dec 2, 6:50 am)
Re: [RFC] Submodules in GIT, Torgil Svensson, (Sat Dec 2, 11:57 am)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Sat Dec 2, 12:41 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Sat Dec 2, 12:46 pm)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Sat Dec 2, 12:52 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Sat Dec 2, 1:12 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Sat Dec 2, 1:18 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Sat Dec 2, 1:21 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Sat Dec 2, 1:24 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Sat Dec 2, 1:40 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Sat Dec 2, 1:43 pm)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Sat Dec 2, 1:44 pm)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Sat Dec 2, 1:46 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Sat Dec 2, 1:58 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Sat Dec 2, 2:06 pm)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Sat Dec 2, 2:22 pm)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Sat Dec 2, 2:29 pm)
Re: [RFC] Submodules in GIT, Josef Weidendorfer, (Sat Dec 2, 5:55 pm)
Re: [RFC] Submodules in GIT, Josef Weidendorfer, (Sat Dec 2, 6:02 pm)
Re: [RFC] Submodules in GIT, Josef Weidendorfer, (Sat Dec 2, 6:11 pm)
Thoughts about memory requirements in traversals [Was: Re: ..., Josef Weidendorfer, (Sat Dec 2, 7:07 pm)
Re: Thoughts about memory requirements in traversals [Was: ..., Josef Weidendorfer, (Sat Dec 2, 8:21 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Sat Dec 2, 11:29 pm)
Re: [RFC] Submodules in GIT, Torgil Svensson, (Sun Dec 3, 2:19 am)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Sun Dec 3, 10:54 am)
Re: [RFC] Submodules in GIT, Andy Parkins, (Sun Dec 3, 12:33 pm)
Re: [RFC] Submodules in GIT, Martin Waitz, (Sun Dec 3, 1:46 pm)
Re: [RFC] Submodules in GIT, Sven Verdoolaege, (Sun Dec 3, 3:16 pm)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Sun Dec 3, 3:32 pm)
Re: [RFC] Submodules in GIT, Josef Weidendorfer, (Mon Dec 4, 4:12 am)
Re: [RFC] Submodules in GIT, Michael K. Edwards, (Mon Dec 4, 11:56 am)
Re: [RFC] Submodules in GIT, Torgil Svensson, (Mon Dec 4, 1:26 pm)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Mon Dec 4, 1:41 pm)
Re: [RFC] Submodules in GIT, Torgil Svensson, (Mon Dec 4, 2:36 pm)
Re: [RFC] Submodules in GIT, Sam Vilain, (Mon Dec 4, 6:31 pm)
Re: [RFC] Submodules in GIT, Daniel Barkalow, (Mon Dec 4, 7:33 pm)
Re: [RFC] Submodules in GIT, Uwe Kleine-Koenig, (Tue Dec 5, 2:01 am)
Re: [RFC] Submodules in GIT, Andreas Ericsson, (Tue Dec 5, 3:33 am)
Re: [RFC] Submodules in GIT, Andreas Ericsson, (Tue Dec 5, 3:38 am)
Re: [RFC] Submodules in GIT, Andreas Ericsson, (Tue Dec 5, 3:42 am)
Re: [RFC] Submodules in GIT, Uwe Kleine-Koenig, (Tue Dec 5, 8:02 am)
Re: [RFC] Submodules in GIT, Andreas Ericsson, (Tue Dec 5, 8:30 am)
Re: [RFC] Submodules in GIT, Sven Verdoolaege, (Tue Dec 5, 9:00 am)
Re: [RFC] Submodules in GIT, sf, (Tue Dec 5, 3:07 pm)
Re: [RFC] Submodules in GIT, Jon Loeliger, (Fri Dec 8, 11:29 am)
Re: [RFC] Submodules in GIT, Sven Verdoolaege, (Fri Dec 8, 11:45 am)
Re: [RFC] Submodules in GIT, R. Steve McKown, (Sat Dec 9, 2:34 pm)
Re: [RFC] Submodules in GIT, Torgil Svensson, (Sun Dec 10, 4:47 am)
Re: [RFC] Submodules in GIT, Andreas Ericsson, (Tue Dec 12, 1:32 am)
Re: [RFC] Submodules in GIT, Torgil Svensson, (Thu Dec 14, 2:27 pm)
Re: [RFC] Submodules in GIT, Josef Weidendorfer, (Thu Dec 14, 4:07 pm)
Re: [RFC] Submodules in GIT, Torgil Svensson, (Fri Dec 15, 10:43 am)
Re: [RFC] Submodules in GIT, Josef Weidendorfer, (Fri Dec 15, 2:42 pm)
Re: [RFC] Submodules in GIT, Torgil Svensson, (Fri Dec 15, 4:43 pm)
Re: [RFC] Submodules in GIT, Torgil Svensson, (Fri Dec 15, 6:13 pm)
Re: [RFC] Submodules in GIT, Torgil Svensson, (Fri Dec 15, 6:20 pm)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Fri Dec 15, 6:49 pm)
Re: [RFC] Submodules in GIT, Linus Torvalds, (Fri Dec 15, 7:12 pm)
Re: [RFC] Submodules in GIT, Torgil Svensson, (Sat Dec 16, 1:50 am)