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

Re: [FR] supporting submodules with alternate version control systems (new contributor)

From
AKAddison Klinke <addison@baller.tv>
Date
May 10, 2022, 17:26 UTC
Message-ID
<CAE9CXujPzu3_95pBDVRXKFU_z40j9Y7v5_1y3c+WnFpz1_oY4w@mail.gmail.com>
In-Reply-To
<01e601d86492$43bb70b0$cb325210$@pdinc.us>
Thanks for the quick replies
> Junio Hamano: When you bind an external repository (be it stored in Git or

somebody else's system) as a submodule, each commit in the superproject records which exact commit in the submodule is used with the rest of the superproject tree.

This should be fine then - at least the data versioning tools I'm familiar with can all specify their current commit and checkout by commit hash. Does it matter how the hashes are structured/stored internally? For example, I believe Dolt keeps them in a MySQL table that connects to Noms under the hood.

 > Junio Hamano: not judging "if it is realistic" at this point
What would be the best approach for answering this portion?
> Jason Pyeron: The submodule "type" could create an object (hashed and stored) that contains the needed "translation" details

That sounds like an interesting idea. Since I'd like to offload the burden of maintaining these translation files to the 3rd party developers, it would be nice if they got copied to a standard location (i.e. ~/.gitmodules/translations/tool_x) during the 3rd party install. Then when a submodule is added with "type = tool_x", git checks that the appropriate translation file is available, and if so, copies it into the parent repository.

On Tue, May 10, 2022 at 11:20 AM Jason Pyeron <jpyeron@pdinc.us> wrote:
Show 55 quoted lines
>
> > -----Original Message-----
> > From: Junio C Hamano
> > Sent: Tuesday, May 10, 2022 1:01 PM
> > To: Addison Klinke <addison@baller.tv>
> >
> > Addison Klinke <addison@baller.tv> writes:
> >
> > > Is something along these lines feasible?
> >
> > Offhand, I only think of one thing that could make it fundamentally
> > infeasible.
> >
> > When you bind an external repository (be it stored in Git or
> > somebody else's system) as a submodule, each commit in the
> > superproject records which exact commit in the submodule is used
> > with the rest of the superproject tree.  And that is done by
> > recording the object name of the commit in the submodule.
> >
> > What it means for the foreign system that wants to "plug into" a
> > superproject in Git as a submodule?  It is required to do two
> > things:
> >
> >  * At the time "git commit" is run at the superproject level, the
> >    foreign system has to be able to say "the version I have to be
> >    used in the context of this superproject commit is X", with X
> >    that somehow can be stored in the superproject's tree object
> >    (which is sized 20-byte for SHA-1 repositories; in SHA-256
> >    repositories, it is a bit wider).
> >
> >  * At the time "git chekcout" is run at the superproject level, the
> >    superproject will learn the above X (i.e. the version of the
> >    submodule that goes with the version of the superproject being
> >    checked out).  The foreign system has to be able to perform a
> >    "checkout" given that X.
> >
> > If a foreign system cannot do the above two, then it fundamentally
> > would be incapable of participating in such a "superproject and
> > submodule" relationship.
>
> The submodule "type" could create an object (hashed and stored) that contains the needed "translation" details. The object would be hashed using SHA1 or SHA256 depending on the git config. The format of the object's contents would be defined by the submodule's "code".
>
>
> --
> Jason Pyeron  | Architect
> PD Inc        | Certified SBA 8(a)
> 10 w 24th St  | Certified SBA HUBZone
> Baltimore, MD | CAGE Code: 1WVR6
>
> .mil: jason.j.pyeron.ctr@mail.mil
> .com: jpyeron@pdinc.us
> tel : 202-741-9397
>
>
>
Previous: Jason PyeronNext: rsbecker@nexbridge.com
Message 4 of 13 in “[FR] supporting submodules with alternate version control systems (new contributor)”
  1. Addison KlinkeMay 10, 2022
  2. Junio C HamanoMay 10, 2022
  3. Jason PyeronMay 10, 2022
  4. Addison KlinkeMay 10, 2022
  5. rsbecker@nexbridge.comMay 10, 2022
  6. Philip OakleyMay 10, 2022
  7. Addison KlinkeJun 1, 2022
  8. Philip OakleyJun 3, 2022
  9. rsbecker@nexbridge.comJun 4, 2022
  10. Philip OakleyJun 4, 2022
  11. rsbecker@nexbridge.comJun 4, 2022
  12. Philip OakleyJun 5, 2022
  13. Addison KlinkeJun 6, 2022

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.