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

Re: git clone does not understand insteadOf URLs

From
Junio C Hamano <gitster@pobox.com>
Date
May 28, 2013, 20:06 UTC
Message-ID
<7v8v2yzx5t.fsf@alter.siamese.dyndns.org>
In-Reply-To
<87a9nhhb9c.fsf@hase.home>
Andreas Schwab <schwab@linux-m68k.org> writes:
Show 8 quoted lines
> Gioele Barabucci <gioele@svario.it> writes:
>
>> Simple, I keep all my projects on the same server, so I would like to
>> refer to that server + path using 'remote-repo'.
>>
>> "git+ssh://git.example.org//users/gioele/projects" insteadOf "remote-repo"
>
> You can use "remote-repo:" instead.

That "with colon" is pretty much how it was designed to be used, but the code did not insist that the insteadof has at least the scheme part, and by mistake allowed something like this

	[url "k.org:/pub/scm/git"] insteadOf = g
to be used with "g/foo" to expand to "k.org:/pub/scm/git/foo".

But if "git fetch g/foo" with such a configuration happily goes to "k.org:/pub/scm/git/foo" without problems, then I think it is very reasonable to delay the "is that a local filename?" short-cut "git clone" does and let the insteadof URL expand take place before it.

Previous: Gioele Barabucci
Message 10 of 10 in “git clone does not understand insteadOf URLs”
  1. Gioele BarabucciMay 25, 2013
  2. Elia PintoMay 26, 2013
  3. Gioele BarabucciMay 26, 2013
  4. Andreas SchwabMay 26, 2013
  5. Gioele BarabucciMay 26, 2013
  6. John KeepingMay 26, 2013
  7. Gioele BarabucciMay 26, 2013
  8. John KeepingMay 26, 2013
  9. Gioele BarabucciMay 26, 2013
  10. Junio C HamanoMay 28, 2013

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.