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

[BUG] Filenames with single colon being treated as remote repository

From
William Giokas <1007380@gmail.com>
Date
Apr 21, 2013, 04:53 UTC
Message-ID
<20130421045329.GB30538@WST420>
All,

It was brought to my attention today that git has some weird behaviour when colons (:) are used in directory names.

In my distros packaging system, for git repositories we clone a bare repo and then clone that bare repo locally as a temporary build directory (no, we can't use cp, it's a bare repository). Say we have a directory, /tmp/foo:bar/baz, that is a git repository. If I want to get a clone of that repository locally, using all of the local optimizations, then I need to run::

    $ git clone /tmp/foo:bar/baz /tmp/new-baz
but running this gives me this output::
    Cloning into 'new-baz'...
    ssh: Could not resolve hostname /tmp/foo: Success
    fatal: Could not read from remote repository.
    Please make sure you have the correct access rights
    and the repository exists.
    
which it should not be doing. It is possible to use a file:// url to
clone it, but then the --local option is ignored and no optimizations
are made. After asking on #git, I was directed to the transport.c file,
but I don't know what in that is failing. We ran some tests on the
is_local function and it seems to work correctly.
Any ideas on how to debug this further?
Thank you,
-- 
William Giokas | KaiSforza
GnuPG Key: 0x73CD09CF
Fingerprint: F73F 50EF BBE2 9846 8306  E6B8 6902 06D8 73CD 09CF
Next: Jonathan Nieder
Message 1 of 16 in “[BUG] Filenames with single colon being treated as remote repository”
  1. William GiokasApr 21, 2013
  2. Jonathan NiederApr 21, 2013
  3. Jeff KingApr 21, 2013
  4. Jonathan NiederApr 21, 2013
  5. Junio C HamanoApr 21, 2013
  6. Jeff KingApr 22, 2013
  7. Junio C HamanoApr 22, 2013
  8. clone: allow cloning local paths with colons in themNguyễn Thái Ngọc Duy, Apr 27, 2013
  9. William GiokasApr 27, 2013
  10. Junio C HamanoApr 27, 2013
  11. Duy NguyenApr 28, 2013
  12. Eric SunshineApr 28, 2013
  13. Duy NguyenApr 28, 2013
  14. clone: allow cloning local paths with colons in themNguyễn Thái Ngọc Duy, May 4, 2013
  15. Junio C HamanoMay 7, 2013
  16. Jeff KingMay 7, 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.