Re: [RFC v2] submodule: Respect requested branch on all clones
- From
W. Trevor King <wking@tremily.us>
- Date
- Jan 9, 2014, 02:22 UTC
- Message-ID
- <20140109022222.GP29954@odin.tremily.us>
- In-Reply-To
- <CALas-igFQtG1qa2+grMAtZ9mDE-xGuXkDGwGvSXL8_FzPfXBLQ@mail.gmail.com>
On Thu, Jan 09, 2014 at 02:09:37AM +0100, Francesco Pretto wrote:
Show 10 quoted lines
> 2014/1/9 W. Trevor King <wking@tremily.us>: > > [branch "my-feature"] > > remote = origin > > merge = refs/heads/my-feature > > [submodule "submod"] > > local-branch = "my-feature" > > > > and I don't think Git's config supports such nesting. > > Aesthetically, It doesn't look very nice.
The INI syntax does not lend itself to easy nesting, but I'm pretty sure some mapping from (<superproject-branch>, <submodule-name>) to <submodule-local-branch-name> is what we need for submodule checkouts. I'm just not sure where local overides to the per-branch .gitmodules should live. We could turn it around, and store:
[superproject "<superproject-branch>"]
local-branch = "<submodule-local-branch-name>"in .git/modules/<submodule-name>/config, with the UI:
$ cd submodule $ git config superproject.<superproject-branch>.local-branch = <submodule-branch>
Not beautiful, but maybe a bit more palatable, and already supported by Git's current config parser. That's enough that I can work up a patch that will hopefully clarify my position ;).
Cheers, Trevor
-- This email may be signed or encrypted with GnuPG (http://www.gnupg.org). For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy