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

Re: problems serving non-bare repos with submodules over http

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 20, 2016, 19:51 UTC
Message-ID
<xmqqh9ewukhw.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAGZ79kYS-F1yKpNP7jmhTiZT1R_pucUBBTCbmHKZz6Xd6dy8EA@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 18 quoted lines
>> 1. After cloning
>>
>>     git clone http://localhost:8080/.git
>>
>>    I cannot 'submodule update' the sub1 in the clone since its url after
>>    'submodule init' would be  http://localhost:8080/.git/sub1 .  If I manually fix
>>    it up -- it seems to proceed normally since in original repository I have
>>    sub1/.git/ directory and not the "gitlink" for that submodule.
>
> So the expected URL would be  http://localhost:8080/sub1/.git ?
>
> I thought you could leave out the .git prefix, i.e. you can type
>
>      git clone http://localhost:8080
>
> and Git will recognize the missing .git and try that as well. The relative URL
> would then be constructed as http://localhost:8080/sub1, which will use the
> same mechanism to find the missing .git ending.

I may be missing the subtleties, but if you are serving others from a non-bare repository with submodules, I do not think you would want to expose the in-tree version of the submodule in the first place.

These $submodule/.git files point via "gitdir:" to their real repository location, don't they? And I would think that they are what you would want to expose to the outside world. Your in-tree submodules may come and go as you checkout different branches in your working tree, but these copies at their real locations will stay.

Previous: Yaroslav HalchenkoNext: Stefan Beller
Message 4 of 12 in “problems serving non-bare repos with submodules over http”
  1. Yaroslav HalchenkoApr 20, 2016
  2. Stefan BellerApr 20, 2016
  3. Yaroslav HalchenkoApr 20, 2016
  4. Junio C HamanoApr 20, 2016
  5. Stefan BellerApr 20, 2016
  6. Junio C HamanoApr 20, 2016
  7. Stefan BellerApr 20, 2016
  8. Yaroslav HalchenkoApr 21, 2016
  9. Stefan BellerApr 21, 2016
  10. Junio C HamanoApr 21, 2016
  11. Stefan BellerApr 21, 2016
  12. Jacob KellerApr 21, 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.