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

Re: url.<base>.insteadOf vs. submodules

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 22, 2017, 02:59 UTC
Message-ID
<xmqqbmtvdj7p.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAGZ79ka2S=V1x2fSQq+E-yE0Ao36-4tuTvnD6uXpPXJPLFN3JA@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 11 quoted lines
>> This is true even without any submodules.  The Git project itself
>> does not even care you are Stefan, but you still can and do add
>> [user] name = "Stefan Beller" to .git/config of your clone of the
>> Git project.  A clone of the project may want to know more than the
>> data project itself keeps track of to describe the context in which
>> the particular clone is being used.  And .git/config is a good place
>> to keep such pieces of information.
>
> This analogy is less clear to me than the kernel& appliance.
> When applying it to you (user.name=Junio) that has write powers
> over the blessed repository, the project cares a lot about you. ;)

The name that is recorded in the project history "Stefan Beller" matters and the project cares about it, when the commit created in that repository is pulled (or exported and imported via the e-mail to "git am" route). But what name you have configured in your repository's .git/config, or the presense of your particular repository for that matter, is much less significant (and that applies to my primary working area as well). The point is that the project and a particular clone of it are entities at conceptually different levels.

Show 11 quoted lines
>> So I would think it is entirely reasonable if "git submodule init
>> sub" that is run in the superproject to initialize "sub" writes
>> something in "sub/.git" to tell that "sub" is used in the context of
>> that particular toplevel superproject and customize its behavour
>> accordingly.  Perhaps it may want to add the url.*.insteadOf that is
>> useful for updating the submodule repository when it does "submodule
>> init", for example.
>
> Do we want to invent a special value for url.*.insteadOf to mean
>   "look up in superproject, so I don't have to keep
>   a copy that may get stale" ?

My gut feeling is that we should do the selective/filtered include Peff mentioned when a repository is known to be used as a submodule of somebody else.

Previous: Stefan BellerNext: Jon Loeliger
Message 13 of 19 in “url.<base>.insteadOf vs. submodules”
  1. ToolforgerFeb 19, 2017
  2. Jeff KingFeb 20, 2017
  3. ToolforgerFeb 20, 2017
  4. Jeff KingFeb 20, 2017
  5. ToolforgerFeb 21, 2017
  6. Jeff KingFeb 21, 2017
  7. Stefan BellerFeb 21, 2017
  8. Jeff KingFeb 21, 2017
  9. Stefan BellerFeb 21, 2017
  10. Junio C HamanoFeb 21, 2017
  11. Junio C HamanoFeb 21, 2017
  12. Stefan BellerFeb 22, 2017
  13. Junio C HamanoFeb 22, 2017
  14. Jon LoeligerFeb 22, 2017
  15. Junio C HamanoFeb 22, 2017
  16. Jeff KingFeb 22, 2017
  17. Stefan BellerFeb 22, 2017
  18. Jeff KingFeb 21, 2017
  19. Stefan BellerFeb 22, 2017

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.