Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 2/2] clone: allow --no-local to turn off local optimizations

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:57

Jeff King [off-list ref] writes:
On Wed, May 30, 2012 at 03:10:37PM -0700, Junio C Hamano wrote:
quoted
Jeff King [off-list ref] writes:
quoted
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.
What I meant to say was that promoting "--local" like your original
series did and giving it a new meaning did not make much sense in
the context of the current semantics (i.e. if the path exists, it is
a path and you do not have to tell "--local" about it), but the
semantics _instead_ needs "--no-local" to be complete; without
"--no-local" that is defined as such, the funny corner case that a
path with the same as $URL prevents you from going to where you want
to go.
Interestingly, it seems that we don't handle this case well at all,
Yes, isn't it interesting?  It is not just we feed it to transport,
but we also store it in the config so later "git fetch" will also do
something inconsistent.  "<scheme>://", primarily because it has
doubled slashes, I wouldn't worry too much about them, but I would
not be surprised if somebody saw scp-style <host>:<path> conflict
with a local path and wished we handled such a case a bit more
sanely.
... Again, these are such silly corner
cases that I suspect it is simply the case that nobody has run into them
or cared.
;-)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help