From: Linus Torvalds <torvalds@linux-foundation.org>
To: Carl Worth <cworth@cworth.org>
Cc: Junio C Hamano <gitster@pobox.com>, Theodore Tso <tytso@mit.edu>,
Jakub Narebski <jnareb@gmail.com>,
Git Mailing List <git@vger.kernel.org>
Subject: Re: Git benchmark - comparison with Bazaar, Darcs, Git and Mercurial
Date: Wed, 1 Aug 2007 10:03:37 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.0.999.0708010937050.3582@woody.linux-foundation.org> (raw)
In-Reply-To: <87tzrjfe5h.wl%cworth@cworth.org>
On Wed, 1 Aug 2007, Carl Worth wrote:
>
> On Wed, 01 Aug 2007 03:15:25 -0700, Junio C Hamano wrote:
> >
> > Are you suggesting to make -l the default for local, in other
> > words? I personally do not make local clone often enough that I
> > am not disturbed having to type extra " -l" on the command line.
>
> Personally, I think it would be a great default.
I suspect it probably *would* make sense to default to "-l". Even if it
makes me get goose-bumps. I freely admit that my worries are totally
illogical.
We might make it something like: "if you use an url, we don't default to
local", so the difference would be that
git clone file:///directory/to/repo
would work the way it does now, but
git clone /directory/to/repo
would default to "-l" behaviour. That kind of would make sense (and should
be easy to implement: it would be a trivial fixup to "connect.c".
Something like this adds support for "file://". And then git-clone could
just do something like
# if the source is a local directory, default to local
if [ -d "$src" ]; then
use_local=yes
fi
or similar.
Linus
---
connect.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/connect.c b/connect.c
index 715cdc0..ae49c5a 100644
--- a/connect.c
+++ b/connect.c
@@ -145,6 +145,8 @@ static enum protocol get_protocol(const char *name)
return PROTO_SSH;
if (!strcmp(name, "ssh+git"))
return PROTO_SSH;
+ if (!strcmp(name, "file"))
+ return PROTO_LOCAL;
die("I don't handle protocol '%s'", name);
}
@@ -498,13 +500,13 @@ pid_t git_connect(int fd[2], char *url, const char *prog, int flags)
end = host;
path = strchr(end, c);
- if (c == ':') {
- if (path) {
+ if (path) {
+ if (c == ':') {
protocol = PROTO_SSH;
*path++ = '\0';
- } else
- path = host;
- }
+ }
+ } else
+ path = end;
if (!path || !*path)
die("No path specified. See 'man git-pull' for valid url syntax");
next prev parent reply other threads:[~2007-08-01 17:04 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-01 0:16 Git benchmark - comparison with Bazaar, Darcs, Git and Mercurial Jakub Narebski
2007-08-01 2:14 ` Linus Torvalds
2007-08-01 5:50 ` Junio C Hamano
2007-08-01 8:48 ` David Kastrup
2007-08-01 9:24 ` Theodore Tso
2007-08-01 10:15 ` Junio C Hamano
2007-08-01 13:20 ` Alex Riesen
2007-08-01 13:20 ` Alex Riesen
2007-08-01 13:23 ` Alex Riesen
2007-08-01 15:49 ` Carl Worth
2007-08-01 17:03 ` Linus Torvalds [this message]
2007-08-01 18:17 ` David Kastrup
2007-08-01 20:36 ` Florian Weimer
2007-08-02 6:09 ` Junio C Hamano
2007-08-02 10:29 ` David Kastrup
2007-08-03 0:51 ` Junio C Hamano
2007-08-03 6:14 ` David Kastrup
2007-08-03 8:20 ` Johan Herland
2007-08-01 22:03 ` Theodore Tso
2007-08-01 22:49 ` Brandon Casey
2007-08-02 4:02 ` Allan Wind
2007-08-02 4:13 ` Linus Torvalds
2007-08-01 22:18 ` Jakub Narebski
2007-08-02 11:19 ` Jakub Narebski
2007-08-02 18:08 ` Ramsay Jones
2007-08-01 8:33 ` Jakub Narebski
2007-08-01 8:48 ` Junio C Hamano
2007-08-01 23:51 ` Jakub Narebski
2007-08-01 2:17 ` Shawn O. Pearce
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=alpine.LFD.0.999.0708010937050.3582@woody.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=cworth@cworth.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jnareb@gmail.com \
--cc=tytso@mit.edu \
/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).