On Tue, Aug 23, 2011 at 10:18:11PM +0200, Jens Lehmann wrote: > Am 23.08.2011 21:43, schrieb Heiko Voigt: > > Another change I am thinking of (which would definitely need an entry in > > the release notes) is to change submodule foreach to iterate over all > > gitmodule entries in the index/HEAD/worktree (not sure yet) instead of > > "just entries that are in .git/config". > > When changing the default I think we'll surprise a lot of users (imagine > someone running a "git submodule foreach pwd" when some submodules aren't > populated). But adding an option to "git submodule foreach" (and maybe others) > to get the list of submodules from the index or HEAD might make sense (while > I'm not sure parsing the work tree does, as you'll basically have to pick up > any .git you find. AFAICS a submodule is defined either by an entry in the > .gitmodules file, in .git/config or through a gitlink entry in a commit or the > index. So maybe the third alternative to index and HEAD is to use those found > in .gitmodules?). > > Could you describe a use case for that? Yes, a repository using the submodule.$name.checkout=none config. Currently its hard to iterate over all submodules to set this config to 'checkout' locally. You can not use submodule foreach for that since it will skip submodule directories that do not have .git in them. But you are right this should obviously be done using an option like git submodule foreach --head ... or similar. Cheers Heiko -- 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