On Mon, May 3, 2010 at 2:00 AM, Junio C Hamano <gitster@xxxxxxxxx> wrote: > Jon Seymour <jon.seymour@xxxxxxxxx> writes: > >> Has consideration ever been given to a submodule-like facility where >> the configuration information maintained in the supermodule for the >> submodule is not a gitlink but is instead the name of a branch (or >> generally, a symbolic reference within the nested submodule). > > I think this comes up from time to time, and there was an even a slightly > more concrete suggestion to us 0{40} in the tree object to denote such an > entry. > > But once people realize that there is no single canonical authoritative > repository whose branch heads point at the same commits for everybody in a > distributed environment, the line of thought to touch gitlink entries gets > retracted or discarded as a misguided idea. > I understand the point about there being no canonical authority, particularly in a truly distributed environment - any use of branches would have to imply that users followed some convention when publishing the entire set. On the other hand, there is actually precedent for use of convention like that in the submodule facility - the use of relative paths to describe the relative locations of submodule repos only really works if everyone who publishes the supermodule uses the filesystem structure for the directories containing the super- and sub-module repos. > I however don't think it would hurt to enrich .gitmodules with not just > the repository information but with branch information to help clones > decide which commit (other than what is recorded in the tree of the > superproject's commit) on the named remote tracking branch to try out with > the superproject's commit. > > I can see that this could work. Presumably git submodule sync would be modified in this case to help switch branches. Also needed, I think, would be a way to sync the .gitmodule file with the current submodule branch assignments. I guess there is no reason why I cannot prototype a facility of this kind with a local helper script. If I it ends up being useful, I'll consider posting a patch. jon. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html