git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>,
	git@vger.kernel.org, "Jonathan Niedier" <jrnieder@gmail.com>,
	"William Giokas" <1007380@gmail.com>,
	fsckdaemon@gmail.com, "Daniel Barkalow" <barkalow@iabervon.org>
Subject: Re: [PATCH v2] clone: allow cloning local paths with colons in them
Date: Tue, 7 May 2013 12:47:27 -0400	[thread overview]
Message-ID: <20130507164727.GA5078@sigill.intra.peff.net> (raw)
In-Reply-To: <7vehdils6c.fsf@alter.siamese.dyndns.org>

On Tue, May 07, 2013 at 08:34:51AM -0700, Junio C Hamano wrote:

> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:
> 
> > diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
> > index 67869b4..0629149 100755
> > --- a/t/t5601-clone.sh
> > +++ b/t/t5601-clone.sh
> > @@ -280,4 +280,9 @@ test_expect_success 'clone checking out a tag' '
> >  	test_cmp fetch.expected fetch.actual
> >  '
> >  
> > +test_expect_success NOT_MINGW,NOT_CYGWIN 'clone local path foo:bar' '
> > +	cp -R src "foo:bar" &&
> > +	git clone "./foo:bar" foobar
> > +'
> 
> Hmph, why not
> 
> 	git clone --mirror src foo:bar &&
>         git clone ./foo:bar foobar

Yeah, not only does that avoid "cp -R", but it is a nice check that we
do not do anything stupid with colons on the dst argument (which we
should obviously not, but it cannot hurt to exercise it).

> or something?  Also do we have a easy negative case we want to test,
> i.e. a case where we do not want the new codepath to trigger by
> mistake?

Yeah, checking "git clone host:path" would be nice, but such a case
would want to go through ssh. I suspect we could point GIT_SSH at a
script like:

  #!/bin/sh
  echo "ssh: $*" >ssh-log &&
  host=$1; shift
  cd "pretend-hosts/$host" && exec "$@"

It looks like t5602 does something similar already.

-Peff

      reply	other threads:[~2013-05-07 16:47 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
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 [this message]

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=20130507164727.GA5078@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=1007380@gmail.com \
    --cc=barkalow@iabervon.org \
    --cc=fsckdaemon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).