{"thread":{"id":"2663","subject":"Why not clone to a remote directory over SSH","startedAt":"2005-11-23T21:16:01Z","lastAt":"2005-11-25T20:26:40Z","messageCount":13,"participants":["Carl Baldwin","Nick Hengeveld","Andreas Ericsson","Junio C Hamano","Johannes Schindelin","Linus Torvalds"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"12641","messageId":"20051123211601.GA2260@hpsvcnb.fc.hp.com","threadId":"2663","inReplyTo":null,"subject":"Why not clone to a remote directory over SSH","fromName":"Carl Baldwin","fromEmail":"cnb@fc.hp.com","sentAt":"2005-11-23T21:16:01Z","receivedAt":"2005-11-23T21:16:01Z","isPatch":false,"sender":{"key":"cnb@fc.hp.com","avatar":null},"body":"It might be cool to enable cloning to a remote over ssh if the remote\ndoesn't yet exist.\n\n% git clone . machine:/path/to/new/repository\n\nIf you try this now it will clone the current working repository to a\nnew directory called 'machine:'.\n\nCarl\n\n-- \n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n Carl Baldwin                        Systems VLSI Laboratory\n Hewlett Packard Company\n MS 88                               work: 970 898-1523\n 3404 E. Harmony Rd.                 work: Carl.N.Baldwin@hp.com\n Fort Collins, CO 80525              home: Carl@ecBaldwin.net\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n"},{"id":"12646","messageId":"20051123230838.GN3968@reactrix.com","threadId":"2663","inReplyTo":"20051123211601.GA2260@hpsvcnb.fc.hp.com","subject":"Re: Why not clone to a remote directory over SSH","fromName":"Nick Hengeveld","fromEmail":"nickh@reactrix.com","sentAt":"2005-11-23T23:08:38Z","receivedAt":"2005-11-23T23:08:38Z","isPatch":false,"sender":{"key":"nickh@reactrix.com","avatar":null},"body":"On Wed, Nov 23, 2005 at 02:16:01PM -0700, Carl Baldwin wrote:\n\n> It might be cool to enable cloning to a remote over ssh if the remote\n> doesn't yet exist.\n\nI would like to see the same for http.  There is limited support for\nmanaging a repository using http but without the ability to run tools\nlike init-db/clone/update-server-info you still need shell access\nor some other workaround.  I think it would be useful to allow someone\nto create, manage, and share a repository without any special\nintelligence on the server side.\n\n-- \nFor a successful technology, reality must take precedence over public\nrelations, for nature cannot be fooled.\n"},{"id":"12647","messageId":"4384F7F6.10404@op5.se","threadId":"2663","inReplyTo":"20051123230838.GN3968@reactrix.com","subject":"Re: Why not clone to a remote directory over SSH","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2005-11-23T23:15:02Z","receivedAt":"2005-11-23T23:15:02Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Nick Hengeveld wrote:\n> On Wed, Nov 23, 2005 at 02:16:01PM -0700, Carl Baldwin wrote:\n> \n> \n>>It might be cool to enable cloning to a remote over ssh if the remote\n>>doesn't yet exist.\n> \n> \n> I would like to see the same for http.  There is limited support for\n> managing a repository using http but without the ability to run tools\n> like init-db/clone/update-server-info you still need shell access\n> or some other workaround.  I think it would be useful to allow someone\n> to create, manage, and share a repository without any special\n> intelligence on the server side.\n> \n\nYou'll still need to install at least git-init-db and git-receive-pack \n(and git-merge, and...), even if they're run through commands from the \nweb. That's pretty special intelligence.\n\nYou'd also have to add some logic to enter_repo() to make it find \nrepositories without a HEAD correctly.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"12649","messageId":"7vd5kr3pz1.fsf@assigned-by-dhcp.cox.net","threadId":"2663","inReplyTo":"20051123211601.GA2260@hpsvcnb.fc.hp.com","subject":"Re: Why not clone to a remote directory over SSH","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-23T23:26:58Z","receivedAt":"2005-11-23T23:26:58Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Carl Baldwin <cnb@fc.hp.com> writes:\n\n> It might be cool to enable cloning to a remote over ssh if the remote\n> doesn't yet exist.\n>\n> % git clone . machine:/path/to/new/repository\n\nI wonder if that is:\n\n\t$ ssh machine 'git clone '`hostname`:`pwd`' /path/to/new/repository'\n\nObviously you need a working git setup on the other end and\nprobably need to be much more careful shell-quoting if your\nhostname and pwd has metacharacters, but...\n"},{"id":"12650","messageId":"20051123232829.GO3968@reactrix.com","threadId":"2663","inReplyTo":"4384F7F6.10404@op5.se","subject":"Re: Why not clone to a remote directory over SSH","fromName":"Nick Hengeveld","fromEmail":"nickh@reactrix.com","sentAt":"2005-11-23T23:28:29Z","receivedAt":"2005-11-23T23:28:29Z","isPatch":false,"sender":{"key":"nickh@reactrix.com","avatar":null},"body":"On Thu, Nov 24, 2005 at 12:15:02AM +0100, Andreas Ericsson wrote:\n\n> You'll still need to install at least git-init-db and git-receive-pack \n> (and git-merge, and...), even if they're run through commands from the \n> web. That's pretty special intelligence.\n\nIf the server is DAV-enabled, a local git-init-db could use HTTP to\ncreate an empty remote repository, and git-http-push can already send\nlocal changes including merges etc. to such a remote repository.\n\nWant to host your project using GIT?  Just use your .Mac iDisk.\n\n-- \nFor a successful technology, reality must take precedence over public\nrelations, for nature cannot be fooled.\n"},{"id":"12652","messageId":"Pine.LNX.4.63.0511240038001.11106@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2663","inReplyTo":"7vd5kr3pz1.fsf@assigned-by-dhcp.cox.net","subject":"Re: Why not clone to a remote directory over SSH","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-11-23T23:41:56Z","receivedAt":"2005-11-23T23:41:56Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 23 Nov 2005, Junio C Hamano wrote:\n\n> \t$ ssh machine 'git clone '`hostname`:`pwd`' /path/to/new/repository'\n\nObviously, this only works if the other side can connect to this side via \nssh. Hmm. Firewalls? Disabled sshd? `hostname` not reliably returning a \nvalid address for the remote side?\n\nHth,\nDscho\n"},{"id":"12654","messageId":"Pine.LNX.4.63.0511240043300.11106@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2663","inReplyTo":"20051123232829.GO3968@reactrix.com","subject":"Re: Why not clone to a remote directory over SSH","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-11-23T23:45:18Z","receivedAt":"2005-11-23T23:45:18Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 23 Nov 2005, Nick Hengeveld wrote:\n\n> If the server is DAV-enabled, a local git-init-db could use HTTP to\n> create an empty remote repository, and git-http-push can already send\n> local changes including merges etc. to such a remote repository.\n> \n> Want to host your project using GIT?  Just use your .Mac iDisk.\n\nThat would be cool! And git-clone could be patched to do just that.\n\nBTW, is it possible to convince git-http-push to store packs on the \nserver?\n\nFor that matter, is it possible to generate the file(s) needed for a dumb \nserver on the client side?\n\nCiao,\nDscho\n"},{"id":"12655","messageId":"20051124001955.GP3968@reactrix.com","threadId":"2663","inReplyTo":"Pine.LNX.4.63.0511240038001.11106@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Why not clone to a remote directory over SSH","fromName":"Nick Hengeveld","fromEmail":"nickh@reactrix.com","sentAt":"2005-11-24T00:19:55Z","receivedAt":"2005-11-24T00:19:55Z","isPatch":false,"sender":{"key":"nickh@reactrix.com","avatar":null},"body":"On Thu, Nov 24, 2005 at 12:41:56AM +0100, Johannes Schindelin wrote:\n\n> Obviously, this only works if the other side can connect to this side via \n> ssh. Hmm. Firewalls? Disabled sshd? `hostname` not reliably returning a \n> valid address for the remote side?\n\nIf sshd is running locally, you can forward a port back to yourself and\nhave the remote clone localhost:`pwd`.  Assuming there's a way to clone\nusing a nonstandard port.\n\n-- \nFor a successful technology, reality must take precedence over public\nrelations, for nature cannot be fooled.\n"},{"id":"12657","messageId":"Pine.LNX.4.64.0511231645100.13959@g5.osdl.org","threadId":"2663","inReplyTo":"Pine.LNX.4.63.0511240038001.11106@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Why not clone to a remote directory over SSH","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-11-24T00:51:27Z","receivedAt":"2005-11-24T00:51:27Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Thu, 24 Nov 2005, Johannes Schindelin wrote:\n> \n> On Wed, 23 Nov 2005, Junio C Hamano wrote:\n> \n> > \t$ ssh machine 'git clone '`hostname`:`pwd`' /path/to/new/repository'\n> \n> Obviously, this only works if the other side can connect to this side via \n> ssh. Hmm. Firewalls? Disabled sshd? `hostname` not reliably returning a \n> valid address for the remote side?\n\nWell, you could also just script it and just do\n\n\tssh machine 'mkdir -p /path/to/new/repository ;\n\t\tcd /path/to/new/repo;\n\t\tgit-init-db'\n\tgit push --all machine:/path/to/new/repository\n\tssh machine 'cd /path/to/new/repo ; git checkout'\n\n(and yes, we could obviously make this a \"git-create-repo\" command, and \nthen you could do\n\n\tgit-send-pack --exec=git-create-repo \\\n\t\tmachine:/path/to/new/repository\n\t\t$(git-rev-parse --all)\n\nor something like that).\n\n\t\tLinus\n"},{"id":"12658","messageId":"20051124010409.GQ3968@reactrix.com","threadId":"2663","inReplyTo":"Pine.LNX.4.63.0511240043300.11106@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Why not clone to a remote directory over SSH","fromName":"Nick Hengeveld","fromEmail":"nickh@reactrix.com","sentAt":"2005-11-24T01:04:09Z","receivedAt":"2005-11-24T01:04:09Z","isPatch":false,"sender":{"key":"nickh@reactrix.com","avatar":null},"body":"On Thu, Nov 24, 2005 at 12:45:18AM +0100, Johannes Schindelin wrote:\n\n> BTW, is it possible to convince git-http-push to store packs on the \n> server?\n\nCertainly, I'm not sure what conditions make sense for using packs\nthough.\n\nWhen pushing changes to the server, there's an advantage to using loose\nobjects in that there is no way to resume a failed transfer.  So if the\nnetwork barfs 99% of the way through, you'll be much less annoyed if\nyou need to retransmit the one object rather than a whole pack.\n\nThe same problem exists if you decide to pack loose objects on the\nserver since the pack would have to be generated locally and then sent\nto the server.  At least in this case, other remote clients would still\nbe able to fetch loose objects while packs were in transit.\n\n> For that matter, is it possible to generate the file(s) needed for a dumb\n> server on the client side?\n\nWhich files are those?  I've been working on a way to update info/refs\nand eventually objects/info/packs.\n\n-- \nFor a successful technology, reality must take precedence over public\nrelations, for nature cannot be fooled.\n"},{"id":"12682","messageId":"43857649.2080502@op5.se","threadId":"2663","inReplyTo":"20051124001955.GP3968@reactrix.com","subject":"Re: Why not clone to a remote directory over SSH","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2005-11-24T08:14:01Z","receivedAt":"2005-11-24T08:14:01Z","isPatch":false,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Nick Hengeveld wrote:\n> On Thu, Nov 24, 2005 at 12:41:56AM +0100, Johannes Schindelin wrote:\n> \n> \n>>Obviously, this only works if the other side can connect to this side via \n>>ssh. Hmm. Firewalls? Disabled sshd? `hostname` not reliably returning a \n>>valid address for the remote side?\n> \n> \n> If sshd is running locally, you can forward a port back to yourself and\n> have the remote clone localhost:`pwd`.  Assuming there's a way to clone\n> using a nonstandard port.\n> \n\nssh://host.xz:port/path/to/repo.git\n\nshould work. If it doesn't I'll fix it.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"12693","messageId":"Pine.LNX.4.63.0511241136370.12985@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"2663","inReplyTo":"20051124010409.GQ3968@reactrix.com","subject":"Re: Why not clone to a remote directory over SSH","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2005-11-24T10:36:58Z","receivedAt":"2005-11-24T10:36:58Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 23 Nov 2005, Nick Hengeveld wrote:\n\n> On Thu, Nov 24, 2005 at 12:45:18AM +0100, Johannes Schindelin wrote:\n> \n> > For that matter, is it possible to generate the file(s) needed for a dumb\n> > server on the client side?\n> \n> Which files are those?  I've been working on a way to update info/refs\n> and eventually objects/info/packs.\n\nThese I meant.\n\nCiao,\nDscho\n"},{"id":"12739","messageId":"20051125202640.GS3968@reactrix.com","threadId":"2663","inReplyTo":"Pine.LNX.4.63.0511241136370.12985@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: Why not clone to a remote directory over SSH","fromName":"Nick Hengeveld","fromEmail":"nickh@reactrix.com","sentAt":"2005-11-25T20:26:40Z","receivedAt":"2005-11-25T20:26:40Z","isPatch":false,"sender":{"key":"nickh@reactrix.com","avatar":null},"body":"On Thu, Nov 24, 2005 at 11:36:58AM +0100, Johannes Schindelin wrote:\n\n> > > For that matter, is it possible to generate the file(s) needed for a dumb\n> > > server on the client side?\n> > \n> > Which files are those?  I've been working on a way to update info/refs\n> > and eventually objects/info/packs.\n> \n> These I meant.\n\nYes - it should be straightforward to generate those files on the client\nside.  A PROPFIND request for the remote directory with Depth: 1 will\nreturn a list of files in the directory, so refs and objects/packs can\nbe crawled to generate the contents of the server info files.  That's\nassuming that packs and tags are being pushed of course.\n\nCome to think of it, PROPFIND is probably a more efficient way to check\nfor the existence of an object in the remote repo as well.  That would\nmake it feasible to remove the --complete option and always verify the\nfull history.\n\n-- \nFor a successful technology, reality must take precedence over public\nrelations, for nature cannot be fooled.\n"}]}