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: git@vger.kernel.org, Emeric Fermas <emeric.fermas@gmail.com>
Subject: Re: [PATCH 2/2] clone: allow --no-local to turn off local optimizations
Date: Wed, 30 May 2012 19:21:16 -0400	[thread overview]
Message-ID: <20120530232116.GA5007@sigill.intra.peff.net> (raw)
In-Reply-To: <7vmx4pxqua.fsf@alter.siamese.dyndns.org>

On Wed, May 30, 2012 at 03:10:37PM -0700, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > Similarly, I find it a little odd that "git clone file:///foo.git" will
> > actually find a file named "file:/foo.git" before checking the URL (IOW,
> > the argument is a path first, and then fallback to URL). I suspect
> > nobody actually cares about either, as they are very unlikely corner
> > cases.
> 
> Yeah, if anything, I would have expected --no-local to mean "I might
> have a local file that happens to be the same as this URL, but I am
> not cloning from there; just go straight to the URL using transports".

But that would not be the opposite of "--local", which you have just
argued is not about interpreting the URL syntax at all, but is about
turning off the local optimization code path when the origin repo is
local.

Interestingly, it seems that we don't handle this case well at all,
anyway. We notice that "file:///foo.git" is resolvable as a path, set
is_local, and set the path to "$PWD/file:///foo.git". But we still feed
that to the transport code to get the list of refs (just not to fetch
them). And the transport code barfs and says "I don't understand the URL
scheme $PWD/file".

So I'm not sure what the actual rules were meant to be, and if we
actually follow them. Or whether there are even intentional rules, and
it is not "what happens to work". Again, these are such silly corner
cases that I suspect it is simply the case that nobody has run into them
or cared.

-Peff

  reply	other threads:[~2012-05-30 23:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-26  3:42 [PATCH 0/3] clone --local fixes Jeff King
2012-05-26  3:42 ` [PATCH 1/3] t5701: modernize style Jeff King
2012-05-26  3:45 ` [PATCH 2/3] clone: make --local handle URLs Jeff King
2012-05-28 18:31   ` Johannes Sixt
2012-05-28 19:10     ` Jeff King
2012-05-26  3:45 ` [PATCH 3/3] clone: allow --no-local to turn off local optimizations Jeff King
2012-05-26  4:11 ` [PATCH 4/3] clone: send diagnostic messages to stderr Jeff King
2012-05-27  6:32 ` [PATCH 0/3] clone --local fixes Junio C Hamano
2012-05-28  5:36   ` Jeff King
2012-05-29 17:43     ` Junio C Hamano
2012-05-30 11:03       ` Jeff King
2012-05-30 11:08         ` Jeff King
2012-05-30 11:09         ` [PATCH 1/2] docs/clone: mention that --local may be ignored Jeff King
2012-05-30 11:10         ` [PATCH 2/2] clone: allow --no-local to turn off local optimizations Jeff King
2012-05-30 17:20           ` Junio C Hamano
2012-05-30 21:59             ` Jeff King
2012-05-30 22:10               ` Junio C Hamano
2012-05-30 23:21                 ` Jeff King [this message]
2012-05-30 23:33                   ` Junio C Hamano

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=20120530232116.GA5007@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=emeric.fermas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).