All of lore.kernel.org
 help / color / mirror / Atom feed
From: William Giokas <1007380@gmail.com>
To: git@vger.kernel.org
Cc: pclouds@gmail.com
Subject: Re: [PATCH] clone: allow cloning local paths with colons in them
Date: Sat, 27 Apr 2013 15:08:42 -0500	[thread overview]
Message-ID: <20130427200842.GA14994@WST420> (raw)
In-Reply-To: <1367033778-13923-1-git-send-email-pclouds@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2396 bytes --]

On Sat, Apr 27, 2013 at 10:36:18AM +0700, Nguyễn Thái Ngọc Duy wrote:
> Usually "foo:bar" is interpreted as an ssh url. This patch allows to
> clone from such paths by putting at least one slash before the colon
> (i.e. /path/to/foo:bar or just ./foo:bar).
> 
> file://foo:bar should also work, but local optimizations are off in
> that case, which may be unwanted. While at there, warn the users about
> --local being ignored in this case.
> 
> Reported-by: William Giokas <1007380@gmail.com>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---

Working fine at the moment for the local clones (thank you). It looks
nice and clean, to me, and doesn't break any existing functionality I
have. 

Though I did notice that if it is a local file, then you don't actually
need a `/` anywhere at all, because I think git looks to see that it is
a local file first. (This is totally fine, though.)

>  On Mon, Apr 22, 2013 at 10:35 PM, Jeff King <peff@peff.net> wrote:
>  > 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.
>  >
>  >   2. Teach git-clone to ask the transport code to parse the source repo
>  >      spec, and decide from that whether it is local or not. That would
>  >      harmonize the implementations and avoid errors when you _did_ mean
>  >      to use ssh, but "host:path" happens to exist in your filesystem. I
>  >      also would not be surprised if there are problems with
>  >      URL-encoding, but maybe clone handles that properly (I didn't
>  >      check).
>  >
>  > And the "host contains slash" rule is pretty easy to explain in the
>  > documentation, which is good.
> 
>  I totally agree with this. But doing #2 seems to require a bit of
>  code reorganization. How about just this for now?
>
>  Documentation/urls.txt | 6 ++++++
>  builtin/clone.c        | 2 ++
>  connect.c              | 7 +++++--
>  t/t5601-clone.sh       | 5 +++++
>  4 files changed, 18 insertions(+), 2 deletions(-)

Thank you,
-- 
William Giokas | KaiSforza
GnuPG Key: 0x73CD09CF
Fingerprint: F73F 50EF BBE2 9846 8306  E6B8 6902 06D8 73CD 09CF

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-04-27 20:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-21  4:53 [BUG] Filenames with single colon being treated as remote repository William Giokas
2013-04-21  6:05 ` Jonathan Nieder
2013-04-21 12:45   ` Jeff King
2013-04-21 16:56     ` Jonathan Nieder
2013-04-21 18:01     ` Junio C Hamano
2013-04-22 15:35       ` Jeff King
2013-04-22 16:00         ` Junio C Hamano
2013-04-27  3:36         ` [PATCH] clone: allow cloning local paths with colons in them Nguyễn Thái Ngọc Duy
2013-04-27 20:08           ` William Giokas [this message]
2013-04-27 21:16           ` Junio C Hamano
2013-04-28  0:19             ` Duy Nguyen
2013-04-28  1:48               ` Eric Sunshine
2013-04-28  2:15                 ` Duy Nguyen
2013-05-04  2:19           ` [PATCH v2] " Nguyễn Thái Ngọc Duy
2013-05-07 15:34             ` Junio C Hamano
2013-05-07 16:47               ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130427200842.GA14994@WST420 \
    --to=1007380@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.