From: "Torsten Bögershausen" <tboegi@web.de>
To: "Junio C Hamano" <gitster@pobox.com>,
"Torsten Bögershausen" <tboegi@web.de>
Cc: Chris Packham <judge.packham@gmail.com>, GIT <git@vger.kernel.org>
Subject: Re: Error when cloning with weird local directory
Date: Sat, 8 Aug 2015 08:26:25 +0200 [thread overview]
Message-ID: <55C5A111.6050902@web.de> (raw)
In-Reply-To: <xmqqpp30zwhu.fsf@gitster.dls.corp.google.com>
On 2015-08-06 09.50, Junio C Hamano wrote:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> Torsten Bögershausen <tboegi@web.de> writes:
>>
>>> It looks as if
>>> static char *get_repo_path(const char *repo, int *is_bundle)
>>> in built/clone.c
>>> checks if there is a local directory structure looking like a
>>> .git directory.
>>> This is wrong.
>>
>> It is as designed, though, to allow cloning from a local directory
>> with any name.
I see the point, but this is what I would expect as a user:
git clone ssh://host/path # Always ssh, never local
git clone ./ssh://host/path # Always local
git clone host:path # scp syntax, border case:
# if a git repo host:path exists on disc,
# use it
git clone ./host:path # local, not scp ('/' before ':')
Beside that, git fetch, git fetch-pack all use the transport helper from
transport.c:
transport
struct transport *transport_get(struct remote *remote, const char *url)
to let the URL being parsed and to make the decision if an URL without a scheme
is ssh or a local file.
So I think that git clone can be slighty more consistant here.
>>
>>> There should be a check for the scheme first.
>>
>> That will be wrong.
>
> It matters mostly when dealing with scp-like syntax, word:path.
>
> I _think_ taking notice of "word://" (with doubled slashes) and
> treating it specially will not introduce any new issue; while it is
> still OK for users to have a local directory called "word:", if they
> meant a subdirectory of it, they wouldn't have typed double-slashes
> there.
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2015-08-08 6:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-06 4:21 Error when cloning with weird local directory Chris Packham
2015-08-06 5:48 ` Torsten Bögershausen
2015-08-06 7:44 ` Junio C Hamano
2015-08-06 7:50 ` Junio C Hamano
2015-08-08 6:26 ` Torsten Bögershausen [this message]
2015-08-10 18:16 ` 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=55C5A111.6050902@web.de \
--to=tboegi@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=judge.packham@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).