From: Jens Lehmann Date: Tue, 13 Dec 2011 21:19:22 GMT Subject: Re: [RFC/PATCH] add update to branch support for "floating submodules" Message-ID: <4EE7C15A.3040501@web.de> In-Reply-To: <4EE770D0.5080702@xiplink.com> Am 13.12.2011 16:35, schrieb Marc Branchaud: > I'd prefer to have floating be explicitly configured on a per-branch (or > per-branch-glob) basis. So in addition to what Jens described yesterday [1] > to configure an individual submodule's floating branch, I suggest there also > be a new section in the .gitmodules file for configuring the super-repo's > floating branches, e.g. > > [super] > floaters = refs/heads/master refs/heads/dev* > > [submodule "Sub1"] > path = foo/bar > branch = maint > url = ... > > [submodule "Sub2"] > path = other/place > url = ... Hmm, but you can have different .gitmodules files in different branches of the superproject, no? Why not just have the "branch = maint" setting for "Sub1" in the master and the dev branches .gitmodules file and drop it in the other branches? > This would mean that whenever the super-repo checks out either the "master" > branch or a branch whose name starts with "dev" (assuming recursive checkouts > are on): > > * The Sub1 submodule automatically checks out the tip of its > "maint" branch. > > * The Sub2 submodule (lacking a "branch" variable) would not float > and would check out the commit recorded in the super-repo. > > A super-repo recursive-checkout that doesn't match a floaters pattern would > work in the regular, non-floating way. Which would just work with my proposal too if git would honor the .gitmodules file of the currently checked out branch. > [1] http://article.gmane.org/gmane.comp.version-control.git/186969