git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH] add update to branch support for "floating submodules"

From
Marc Branchaud <marcnarc@xiplink.com>
Date
Dec 13, 2011, 22:42 UTC
Message-ID
<4EE7D4E0.5000305@xiplink.com>
In-Reply-To
<4EE7C15A.3040501@web.de>
On 11-12-13 04:19 PM, Jens Lehmann wrote:
Show 21 quoted lines
> 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?
Yes.  I'm not sure I see that as a problem though.
> 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?
Because I think that's an error-prone approach.

If the user creates a topic branch off (an ancestor) of master, git doesn't know if the user wants floating submodules or not. If this is a bugfix topic, the user would have to edit .gitmodules to turn off floating. But that modified .gitmodules is too easily committed to the branch, and once it gets merged back into master suddenly master loses its "floating" feature.

What's more, less-sophisticated users would be wary of editing an "internal" file like .gitmodules.

Instead I think it's more intuitive for the repository to define which branches get floating submodules and which don't, and IMO a list of names/globs is a good way to do that. The repo's users would need to be aware of what the magic branch names are, but I think that's easily communicated in the floating-submodule scenarios I've seen posted. Git could also help by telling the user, when a branch is created or it's name is displayed, whether or not it's got floating submodules.

		M.
Previous: Jens LehmannNext: Junio C Hamano
Message 16 of 27 in “add update to branch support for "floating submodules"”
  1. add update to branch support for "floating submodules"Heiko Voigt, Nov 9, 2011
  2. Junio C HamanoNov 9, 2011
  3. Heiko VoigtNov 29, 2011
  4. Leif GruenwoldtDec 10, 2011
  5. Jonathan NiederDec 10, 2011
  6. Junio C HamanoDec 10, 2011
  7. Leif GruenwoldtDec 10, 2011
  8. Andreas T.AuerDec 12, 2011
  9. Leif GruenwoldtDec 12, 2011
  10. Andreas T.AuerDec 12, 2011
  11. Leif GruenwoldtDec 12, 2011
  12. Jens LehmannDec 12, 2011
  13. Phil HordDec 12, 2011
  14. Marc BranchaudDec 13, 2011
  15. Jens LehmannDec 13, 2011
  16. Marc BranchaudDec 13, 2011
  17. Junio C HamanoDec 12, 2011
  18. Phil HordDec 13, 2011
  19. Jens LehmannDec 13, 2011
  20. Phil HordJan 30, 2012
  21. Jens LehmannJan 31, 2012
  22. Phil HordJan 31, 2012
  23. Jens LehmannFeb 1, 2012
  24. Phil HordFeb 6, 2012
  25. Jens LehmannFeb 6, 2012
  26. Brandon CaseyDec 13, 2011
  27. Gioele BarabucciDec 10, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.