From: Stefan Beller Date: Mon, 08 May 2017 17:15:35 GMT Subject: Re: Add an option to automatically submodule update on checkout Message-ID: In-Reply-To: <20170508170846.GD179149@google.com> On Mon, May 8, 2017 at 10:08 AM, Brandon Williams wrote: >> >> >[submodule "gnulib"] >> > path=./gnulib >> > external = true # implies no branch for checkout -b --recurse-submodules >> >> >I think there are a couple more situations where such "external" submodules are treated differently, so maybe we'd want to think carefully about the >actual name as different workflows would want to have different features for an internal/external submodule. >> >> I didn't want to open up that one, but yes. That makes sense. However, I don't like overloading what "external" means or might mean in the future. Would you consider a distinct Boolean for that, like inherit-branch=true? > > Something like that kind of already exists. The 'branch' field. > Internal repos would most likely use the '.' value to indicate that the > submodules should track the superproject's branch. While a value of say > 'foo' would indicate that the submodule should always be on branch > 'foo'; this could be used for external repositories. so for external repos you'd keep the branch unset, such that you strictly checkout the sha1 object into a detached HEAD. Makes sense. Thanks, Stefan