git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why not clone to a remote directory over SSH
@ 2005-11-23 21:16 Carl Baldwin
  2005-11-23 23:08 ` Nick Hengeveld
  2005-11-23 23:26 ` Junio C Hamano
  0 siblings, 2 replies; 13+ messages in thread
From: Carl Baldwin @ 2005-11-23 21:16 UTC (permalink / raw)
  To: git

It might be cool to enable cloning to a remote over ssh if the remote
doesn't yet exist.

% git clone . machine:/path/to/new/repository

If you try this now it will clone the current working repository to a
new directory called 'machine:'.

Carl

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 Carl Baldwin                        Systems VLSI Laboratory
 Hewlett Packard Company
 MS 88                               work: 970 898-1523
 3404 E. Harmony Rd.                 work: Carl.N.Baldwin@hp.com
 Fort Collins, CO 80525              home: Carl@ecBaldwin.net
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Why not clone to a remote directory over SSH
  2005-11-23 21:16 Why not clone to a remote directory over SSH Carl Baldwin
@ 2005-11-23 23:08 ` Nick Hengeveld
  2005-11-23 23:15   ` Andreas Ericsson
  2005-11-23 23:26 ` Junio C Hamano
  1 sibling, 1 reply; 13+ messages in thread
From: Nick Hengeveld @ 2005-11-23 23:08 UTC (permalink / raw)
  To: git

On Wed, Nov 23, 2005 at 02:16:01PM -0700, Carl Baldwin wrote:

> It might be cool to enable cloning to a remote over ssh if the remote
> doesn't yet exist.

I would like to see the same for http.  There is limited support for
managing a repository using http but without the ability to run tools
like init-db/clone/update-server-info you still need shell access
or some other workaround.  I think it would be useful to allow someone
to create, manage, and share a repository without any special
intelligence on the server side.

-- 
For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Why not clone to a remote directory over SSH
  2005-11-23 23:08 ` Nick Hengeveld
@ 2005-11-23 23:15   ` Andreas Ericsson
  2005-11-23 23:28     ` Nick Hengeveld
  0 siblings, 1 reply; 13+ messages in thread
From: Andreas Ericsson @ 2005-11-23 23:15 UTC (permalink / raw)
  To: Nick Hengeveld; +Cc: git

Nick Hengeveld wrote:
> On Wed, Nov 23, 2005 at 02:16:01PM -0700, Carl Baldwin wrote:
> 
> 
>>It might be cool to enable cloning to a remote over ssh if the remote
>>doesn't yet exist.
> 
> 
> I would like to see the same for http.  There is limited support for
> managing a repository using http but without the ability to run tools
> like init-db/clone/update-server-info you still need shell access
> or some other workaround.  I think it would be useful to allow someone
> to create, manage, and share a repository without any special
> intelligence on the server side.
> 

You'll still need to install at least git-init-db and git-receive-pack 
(and git-merge, and...), even if they're run through commands from the 
web. That's pretty special intelligence.

You'd also have to add some logic to enter_repo() to make it find 
repositories without a HEAD correctly.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Why not clone to a remote directory over SSH
  2005-11-23 21:16 Why not clone to a remote directory over SSH Carl Baldwin
  2005-11-23 23:08 ` Nick Hengeveld
@ 2005-11-23 23:26 ` Junio C Hamano
  2005-11-23 23:41   ` Johannes Schindelin
  1 sibling, 1 reply; 13+ messages in thread
From: Junio C Hamano @ 2005-11-23 23:26 UTC (permalink / raw)
  To: Carl Baldwin; +Cc: git

Carl Baldwin <cnb@fc.hp.com> writes:

> It might be cool to enable cloning to a remote over ssh if the remote
> doesn't yet exist.
>
> % git clone . machine:/path/to/new/repository

I wonder if that is:

	$ ssh machine 'git clone '`hostname`:`pwd`' /path/to/new/repository'

Obviously you need a working git setup on the other end and
probably need to be much more careful shell-quoting if your
hostname and pwd has metacharacters, but...

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Why not clone to a remote directory over SSH
  2005-11-23 23:15   ` Andreas Ericsson
@ 2005-11-23 23:28     ` Nick Hengeveld
  2005-11-23 23:45       ` Johannes Schindelin
  0 siblings, 1 reply; 13+ messages in thread
From: Nick Hengeveld @ 2005-11-23 23:28 UTC (permalink / raw)
  To: Andreas Ericsson; +Cc: git

On Thu, Nov 24, 2005 at 12:15:02AM +0100, Andreas Ericsson wrote:

> You'll still need to install at least git-init-db and git-receive-pack 
> (and git-merge, and...), even if they're run through commands from the 
> web. That's pretty special intelligence.

If the server is DAV-enabled, a local git-init-db could use HTTP to
create an empty remote repository, and git-http-push can already send
local changes including merges etc. to such a remote repository.

Want to host your project using GIT?  Just use your .Mac iDisk.

-- 
For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Why not clone to a remote directory over SSH
  2005-11-23 23:26 ` Junio C Hamano
@ 2005-11-23 23:41   ` Johannes Schindelin
  2005-11-24  0:19     ` Nick Hengeveld
  2005-11-24  0:51     ` Linus Torvalds
  0 siblings, 2 replies; 13+ messages in thread
From: Johannes Schindelin @ 2005-11-23 23:41 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Carl Baldwin, git

Hi,

On Wed, 23 Nov 2005, Junio C Hamano wrote:

> 	$ ssh machine 'git clone '`hostname`:`pwd`' /path/to/new/repository'

Obviously, this only works if the other side can connect to this side via 
ssh. Hmm. Firewalls? Disabled sshd? `hostname` not reliably returning a 
valid address for the remote side?

Hth,
Dscho

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Why not clone to a remote directory over SSH
  2005-11-23 23:28     ` Nick Hengeveld
@ 2005-11-23 23:45       ` Johannes Schindelin
  2005-11-24  1:04         ` Nick Hengeveld
  0 siblings, 1 reply; 13+ messages in thread
From: Johannes Schindelin @ 2005-11-23 23:45 UTC (permalink / raw)
  To: Nick Hengeveld; +Cc: Andreas Ericsson, git

Hi,

On Wed, 23 Nov 2005, Nick Hengeveld wrote:

> If the server is DAV-enabled, a local git-init-db could use HTTP to
> create an empty remote repository, and git-http-push can already send
> local changes including merges etc. to such a remote repository.
> 
> Want to host your project using GIT?  Just use your .Mac iDisk.

That would be cool! And git-clone could be patched to do just that.

BTW, is it possible to convince git-http-push to store packs on the 
server?

For that matter, is it possible to generate the file(s) needed for a dumb 
server on the client side?

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Why not clone to a remote directory over SSH
  2005-11-23 23:41   ` Johannes Schindelin
@ 2005-11-24  0:19     ` Nick Hengeveld
  2005-11-24  8:14       ` Andreas Ericsson
  2005-11-24  0:51     ` Linus Torvalds
  1 sibling, 1 reply; 13+ messages in thread
From: Nick Hengeveld @ 2005-11-24  0:19 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Junio C Hamano, Carl Baldwin, git

On Thu, Nov 24, 2005 at 12:41:56AM +0100, Johannes Schindelin wrote:

> Obviously, this only works if the other side can connect to this side via 
> ssh. Hmm. Firewalls? Disabled sshd? `hostname` not reliably returning a 
> valid address for the remote side?

If sshd is running locally, you can forward a port back to yourself and
have the remote clone localhost:`pwd`.  Assuming there's a way to clone
using a nonstandard port.

-- 
For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Why not clone to a remote directory over SSH
  2005-11-23 23:41   ` Johannes Schindelin
  2005-11-24  0:19     ` Nick Hengeveld
@ 2005-11-24  0:51     ` Linus Torvalds
  1 sibling, 0 replies; 13+ messages in thread
From: Linus Torvalds @ 2005-11-24  0:51 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Junio C Hamano, Carl Baldwin, git



On Thu, 24 Nov 2005, Johannes Schindelin wrote:
> 
> On Wed, 23 Nov 2005, Junio C Hamano wrote:
> 
> > 	$ ssh machine 'git clone '`hostname`:`pwd`' /path/to/new/repository'
> 
> Obviously, this only works if the other side can connect to this side via 
> ssh. Hmm. Firewalls? Disabled sshd? `hostname` not reliably returning a 
> valid address for the remote side?

Well, you could also just script it and just do

	ssh machine 'mkdir -p /path/to/new/repository ;
		cd /path/to/new/repo;
		git-init-db'
	git push --all machine:/path/to/new/repository
	ssh machine 'cd /path/to/new/repo ; git checkout'

(and yes, we could obviously make this a "git-create-repo" command, and 
then you could do

	git-send-pack --exec=git-create-repo \
		machine:/path/to/new/repository
		$(git-rev-parse --all)

or something like that).

		Linus

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Why not clone to a remote directory over SSH
  2005-11-23 23:45       ` Johannes Schindelin
@ 2005-11-24  1:04         ` Nick Hengeveld
  2005-11-24 10:36           ` Johannes Schindelin
  0 siblings, 1 reply; 13+ messages in thread
From: Nick Hengeveld @ 2005-11-24  1:04 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Andreas Ericsson, git

On Thu, Nov 24, 2005 at 12:45:18AM +0100, Johannes Schindelin wrote:

> BTW, is it possible to convince git-http-push to store packs on the 
> server?

Certainly, I'm not sure what conditions make sense for using packs
though.

When pushing changes to the server, there's an advantage to using loose
objects in that there is no way to resume a failed transfer.  So if the
network barfs 99% of the way through, you'll be much less annoyed if
you need to retransmit the one object rather than a whole pack.

The same problem exists if you decide to pack loose objects on the
server since the pack would have to be generated locally and then sent
to the server.  At least in this case, other remote clients would still
be able to fetch loose objects while packs were in transit.

> For that matter, is it possible to generate the file(s) needed for a dumb
> server on the client side?

Which files are those?  I've been working on a way to update info/refs
and eventually objects/info/packs.

-- 
For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Why not clone to a remote directory over SSH
  2005-11-24  0:19     ` Nick Hengeveld
@ 2005-11-24  8:14       ` Andreas Ericsson
  0 siblings, 0 replies; 13+ messages in thread
From: Andreas Ericsson @ 2005-11-24  8:14 UTC (permalink / raw)
  To: Nick Hengeveld; +Cc: Johannes Schindelin, Junio C Hamano, Carl Baldwin, git

Nick Hengeveld wrote:
> On Thu, Nov 24, 2005 at 12:41:56AM +0100, Johannes Schindelin wrote:
> 
> 
>>Obviously, this only works if the other side can connect to this side via 
>>ssh. Hmm. Firewalls? Disabled sshd? `hostname` not reliably returning a 
>>valid address for the remote side?
> 
> 
> If sshd is running locally, you can forward a port back to yourself and
> have the remote clone localhost:`pwd`.  Assuming there's a way to clone
> using a nonstandard port.
> 

ssh://host.xz:port/path/to/repo.git

should work. If it doesn't I'll fix it.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Why not clone to a remote directory over SSH
  2005-11-24  1:04         ` Nick Hengeveld
@ 2005-11-24 10:36           ` Johannes Schindelin
  2005-11-25 20:26             ` Nick Hengeveld
  0 siblings, 1 reply; 13+ messages in thread
From: Johannes Schindelin @ 2005-11-24 10:36 UTC (permalink / raw)
  To: Nick Hengeveld; +Cc: Andreas Ericsson, git

Hi,

On Wed, 23 Nov 2005, Nick Hengeveld wrote:

> On Thu, Nov 24, 2005 at 12:45:18AM +0100, Johannes Schindelin wrote:
> 
> > For that matter, is it possible to generate the file(s) needed for a dumb
> > server on the client side?
> 
> Which files are those?  I've been working on a way to update info/refs
> and eventually objects/info/packs.

These I meant.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Why not clone to a remote directory over SSH
  2005-11-24 10:36           ` Johannes Schindelin
@ 2005-11-25 20:26             ` Nick Hengeveld
  0 siblings, 0 replies; 13+ messages in thread
From: Nick Hengeveld @ 2005-11-25 20:26 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Andreas Ericsson, git

On Thu, Nov 24, 2005 at 11:36:58AM +0100, Johannes Schindelin wrote:

> > > For that matter, is it possible to generate the file(s) needed for a dumb
> > > server on the client side?
> > 
> > Which files are those?  I've been working on a way to update info/refs
> > and eventually objects/info/packs.
> 
> These I meant.

Yes - it should be straightforward to generate those files on the client
side.  A PROPFIND request for the remote directory with Depth: 1 will
return a list of files in the directory, so refs and objects/packs can
be crawled to generate the contents of the server info files.  That's
assuming that packs and tags are being pushed of course.

Come to think of it, PROPFIND is probably a more efficient way to check
for the existence of an object in the remote repo as well.  That would
make it feasible to remove the --complete option and always verify the
full history.

-- 
For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2005-11-25 20:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-23 21:16 Why not clone to a remote directory over SSH Carl Baldwin
2005-11-23 23:08 ` Nick Hengeveld
2005-11-23 23:15   ` Andreas Ericsson
2005-11-23 23:28     ` Nick Hengeveld
2005-11-23 23:45       ` Johannes Schindelin
2005-11-24  1:04         ` Nick Hengeveld
2005-11-24 10:36           ` Johannes Schindelin
2005-11-25 20:26             ` Nick Hengeveld
2005-11-23 23:26 ` Junio C Hamano
2005-11-23 23:41   ` Johannes Schindelin
2005-11-24  0:19     ` Nick Hengeveld
2005-11-24  8:14       ` Andreas Ericsson
2005-11-24  0:51     ` Linus Torvalds

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).