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

Re: [PATCHv3] submodule--helper: normalize funny urls

From
Stefan Beller <sbeller@google.com>
Date
Oct 21, 2016, 20:56 UTC
Message-ID
<CAGZ79kYXyUr9qets_xkHU4NekSz2J67=Pheu=fTq5ztx0gRu2w@mail.gmail.com>
In-Reply-To
<xmqqwph5m6th.fsf@gitster.mtv.corp.google.com>
On Tue, Oct 18, 2016 at 7:05 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 20 quoted lines
> Stefan Beller <sbeller@google.com> writes:
>
>>> I am not sure.  Certainly we would want to make sure that the normal
>>> case (i.e. no funny trailing junk) to work correctly, but we do want
>>> to protect the fix from future breakage as well, no?
>>
>> Exactly. So not intermediate "root" that we clone from, but adapting the
>> relative URLs. Maybe half the broken tests can switch to 'root' and the others
>> go with the current behavior of cloning . to super.
>>>
>>> Perhaps we can do a preliminary step to update tests to primarily
>>> check the cases that do not involve URL with trailing "/." by either
>>> doing that double clone, or more preferrably, clone from "$(pwd)"
>>> and adjust the incorrect submodule reference that have been relying
>>> on the buggy behaviour.  With that "root" trick, the test would pass
>>> with or without the fix under discussion, right?
>>
>> I assume so, (not tested).
>
> OK.  Thanks for sticking with it.

Ok, the root trick works fine without the fix, however we preferrably want to fix it without double cloning, then the fix becomes a bit harder to follow:

instead of
    git clone . super
we do
    git clone "$(pwd)" super &&
    git -C super config --unset remote.origin.url &&

instead, such that the relative urls work the same way. (The super becomes its own authoritative source of truth with no upstream. In that case the url is relative to the superproject, e.g.

    git -C super submodule add ../submodule

will then resolve the relative path from super/../submodule to be just as before, where we bugily used $(git config remote.origin.url = ...super/.)/../submodule, which due to the but resolved to the submodule as well (as /. was counted as a directory).

Previous: Junio C Hamano
Message 12 of 12 in “[PATCHv3] submodule--helper: normalize funny urls”
  1. Stefan BellerOct 18, 2016
  2. Junio C HamanoOct 18, 2016
  3. Junio C HamanoOct 18, 2016
  4. Stefan BellerOct 18, 2016
  5. Junio C HamanoOct 19, 2016
  6. Stefan BellerOct 19, 2016
  7. Junio C HamanoOct 19, 2016
  8. Stefan BellerOct 20, 2016
  9. Junio C HamanoOct 20, 2016
  10. Stefan BellerOct 20, 2016
  11. Junio C HamanoOct 20, 2016
  12. Stefan BellerOct 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.