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

2013-04-22 Thread Jeff King
On Sun, Apr 21, 2013 at 11:01:58AM -0700, Junio C Hamano wrote: I think the rule could be something like: 1. If it looks like a URL (^scheme://), it is. 2. Otherwise, if it is a path in the filesystem, it is. 3. Otherwise, if it has a colon, it's host:path 4. Otherwise,

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

2013-04-22 Thread Junio C Hamano
Jeff King p...@peff.net writes: So I think one reasonable path would be: 1. Do not treat host:path as ssh if host has a slash, which should not regress anybody. It does not allow unadorned relative paths with colons, but it lets you use absolute paths or ./ to disambiguate.

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

2013-04-21 Thread Jonathan Nieder
Hi, William Giokas wrote: $ 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. Here's a toy patch. I haven't thought

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

2013-04-21 Thread Jeff King
On Sat, Apr 20, 2013 at 11:05:39PM -0700, Jonathan Nieder wrote: Cloning into 'new-baz'... ssh: Could not resolve hostname /tmp/foo: Success fatal: Could not read from remote repository. Here's a toy patch. I haven't thought carefully about whether it's a good idea, but

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

2013-04-21 Thread Jonathan Nieder
Jeff King wrote: I don't think that is enough. Something like /path/to/foo:bar would trigger !is_url already, but then git_connect fails. Doh. Here's another try, still untested. diff --git i/connect.c w/connect.c index 49e56ba3..fe13942f 100644 --- i/connect.c +++ w/connect.c @@ -504,6

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

2013-04-21 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Sat, Apr 20, 2013 at 11:05:39PM -0700, Jonathan Nieder wrote: Cloning into 'new-baz'... ssh: Could not resolve hostname /tmp/foo: Success fatal: Could not read from remote repository. Here's a toy patch. I haven't thought carefully about