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

Re: Reference a submodule branch instead of a commit

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 3, 2016, 19:00 UTC
Message-ID
<xmqqfuod6yw2.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<57F29FEF.30700@game-point.net>
Jeremy Morton <admin@game-point.net> writes:
Show 6 quoted lines
> At the moment, supermodules must reference a given commit in each of
> its submodules.  If one is in control of a submodule and it changes on
> a regular basis, this can cause a lot of overhead with "submodule
> updated" commits in the supermodule.  It would be useful of git allows
> the option of referencing a submodule's branch instead of a given
> submodule commit.  How about adding this functionality?

When somebody downstream fetches from your superproject and grabs the set of submodules, how would s/he know what _exact_ state you meant to record? When s/he says "I have your superproject commit X, which binds submodule's branch Y at path sub/, and it simply does not work. Your project is broken", how do you go about reproducing the exact state s/he had trouble with to help her/him?

The only thing s/he knows is that the commit used from the submodule must be one of the commits that was on branch Y at some point in time, hopefully close to the timestamp recorded in the commit in the superproject. And your record in the history of the superproject does not tell you more than that, so you wouldn't have any idea better than what s/he already has to help.

Hence, such a "functionality" will never happen, at least in the exact form you are describing.

It is conceivable to add some feature that allows you to squelch the report that the submodule recorded in your superproject is not up to date from "git status" etc. to help those who thinks it is OK to not bind the latest submodule commit to the superproject all the time, though.

Previous: Jeremy MortonNext: Heiko Voigt
Message 2 of 9 in “Reference a submodule branch instead of a commit”
  1. Jeremy MortonOct 3, 2016
  2. Junio C HamanoOct 3, 2016
  3. Heiko VoigtOct 4, 2016
  4. Stefan BellerOct 4, 2016
  5. Junio C HamanoOct 4, 2016
  6. Junio C HamanoOct 4, 2016
  7. Heiko VoigtOct 5, 2016
  8. Junio C HamanoOct 5, 2016
  9. Heiko VoigtOct 5, 2016

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.