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

Re: git clone NonExistentLocation

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Feb 17, 2011, 12:59 UTC
Message-ID
<4D5D1BCB.3010003@drmicha.warpmail.net>
In-Reply-To
<4D5D1A04.4090107@atlas-elektronik.com>
Stefan Naewe venit, vidit, dixit 17.02.2011 13:52:
Show 14 quoted lines
> On 2/17/2011 1:39 PM, Michael J Gruber wrote:
>>
>> It is useful, and it even gives you a warning that it still might not be
>> what you intended. Would be funny if it were accidental. Indeed, a git
>> "log -S" on that warning reveals that it was introduced intentionally in
>>
>> 86ac751 (Allow cloning an empty repository, 2009-01-23)
> 
> OK. But that's about 'cloning an empty repository'.
> 'NonExistentLocation' is not empty initially - it simply does
> not exist.
> 
> Contrast that to 'git clone http://url.does.not.exist'. You don't
> get an empty repository in 'url.does.not.exist' after running that.
OK, the transport layer errors out in that case.

Rereading Sverre's commit message, I'm still not sure whether this case was intended or not. The test case covers existing empty repos only. So I'm cc'ing him and holding back by documentation patch.

Sverre, with your 86ac751, the following two are equivalent (modulo a warning) on a nonexisting dir:

git clone dir git init dir

Is that intentional?
Michael
Previous: Stefan NaeweNext: Sverre Rabbelier
Message 4 of 10 in “git clone NonExistentLocation”
  1. Stefan NaeweFeb 17, 2011
  2. Michael J GruberFeb 17, 2011
  3. Stefan NaeweFeb 17, 2011
  4. Michael J GruberFeb 17, 2011
  5. Sverre RabbelierFeb 17, 2011
  6. Michael J GruberFeb 17, 2011
  7. Jeff KingFeb 18, 2011
  8. Junio C HamanoFeb 18, 2011
  9. Jeff KingFeb 18, 2011
  10. Sverre RabbelierFeb 18, 2011

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.