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
| debian developer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Tim Tassonis | reiser4 for 2.6.27-rc1 |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Peter Zijlstra | [PATCH 6/6] sched: disabled rt-bandwidth by default |
git: | |
| Alex Riesen | Re: question about git-submodule |
| Greg KH | Re: [ANNOUNCE] pg - A patch porcelain for GIT |
| Nicolas Pitre | Re: git-index-pack really does suck.. |
| Bill Lear | Meaning of "fatal: protocol error: bad line length character"? |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Matt | Setting up a virtual hosting machine w. SSH/SFTP accounts - pitfalls/experiences? |
| Marco Peereboom | Re: Real men don't attack straw men |
| bsd_news | LC_COLLATE and PostgreSQL |
| Eric Sandeen | Re: [RFC] Heads up on sys_fallocate() |
| John Stoffel | Re: [PATCH] LogFS take three |
| Al Boldi | Re: [RFD] Incremental fsck |
| Alex Zarochentsev | Re: silent semantic changes with reiser4 |
