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

Re: Git repository name-guessing corner case

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 11, 2012, 20:09 UTC
Message-ID
<7vwr3d625y.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1339442931056-7561236.post@n2.nabble.com>
Joseph Chiu <joechiu@joechiu.com> writes:
> On the south machine, I first accidentally created the repo wizard.git.git
> (note the double .git), with ...

We have updated the logic around this area with b3256eb (standardize and improve lookup rules for external local repos, 2012-02-02), and this is part of v1.7.9.2 and later releases. The rule used to be (1) check with "/.git" appended, to cover the case where you access a repository with a working tree attached, (2) check with ".git" appended, and then (3) check without anything appended. It was very error prone to cause exactly the above kind of gotchas.

The updated rule checks with "/.git" first andthe next possibility that is checked is the given name without modification, so if you have both wizard.git and wizard.git.git (with or without working tree):

        accessing with this name ... will find this repository
        wizard                       wizard.git
        wizard.git                   wizard.git
        wizard.git.git               wizard.git.git
which should be much saner.
Previous: Joseph Chiu
Message 2 of 2 in “Git repository name-guessing corner case”
  1. Joseph ChiuJun 11, 2012
  2. Junio C HamanoJun 11, 2012

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.