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

Re: [PATCH] submodule: allow gitsubmodules to be pointed at tags

From
Sean Allred <allred.sean@gmail.com>
Date
Jun 24, 2024, 13:45 UTC
Message-ID
<m0sex2pi7q.fsf@epic96565.epic.com>
In-Reply-To
<7D5BFC58-9BF1-4818-828D-453C416949EB@mykolab.com>
Show 11 quoted lines
> On 24 June 2024 13:26:48 UTC, Sean Allred <allred.sean@gmail.com> wrote:
>>This is an interesting idea, so far as I understand it. I certainly
>>appreciate the desire to freeze your dependencies. I don't use
>>submodules often, but I do want to point out an inherent assumption in
>>your design: that tags don't move.
>>
>>Tags can move. It's usually impolite, but there can be reasonable
>>use-cases for doing so.
>>
>>With this in mind, what can go wrong if you have a submodule with a
>>configuration that doesn't necessarily match the tree?
David <dark0dave@mykolab.com> writes:
Show 6 quoted lines
> That's fine, my assumption is that if the tag moved the owner of the
> repo intends this to happen. Like a hot fix or security change.
>
> What will happen is on update the submodule will be moved to the new
> commit. Just like if a branch was updated. Its very similar code
> between the two, as this is a super light touch change.

I'm assuming that the superproject tree itself still gets the subproject commit OID, so the commit is still stable when tags in the subproject are moved (setting aside the possibility that the commit in the subproject may no longer be reachable... *shudder*). But doesn't it seem odd -- particularly for the concept of tags -- that the behavior of updating that tree could change depending on when you do it? For developers that add external dependencies as subprojects and choose to use this tagging feature, they could be in for a real surprise if they don't realize this quirk of the implementation -- and they could consider that behavior broken.

If you're ok with that behavior, then does it make sense to generalize it to the concept of a ref instead of just a tag name? This may do a better job of communicating the idea that no ref is inherently immovable. (Not saying this is a good idea, but answering that question might further hone in on why tags are the 'right' choice here as opposed to any named commit.)

-- 
Sean Allred
Previous: Sean AllredNext: Junio C Hamano
Message 3 of 4 in “submodule: allow gitsubmodules to be pointed at tags”
  1. submodule: allow gitsubmodules to be pointed at tagsdark0dave via GitGitGadget, Jun 17, 2024
  2. Sean AllredJun 24, 2024
  3. Sean AllredJun 24, 2024
  4. Junio C HamanoJun 24, 2024

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.