{"thread":{"id":"56348","subject":"Get tree of remote repository using custom ssh library.","startedAt":"2021-08-22T18:47:35Z","lastAt":"2021-08-25T06:54:36Z","messageCount":4,"participants":["Stef Bon","Kevin Daudt"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"433330","messageId":"CANXojcyX2uqAp5gLtfH8ffQFQBKkMoPqSzpDUnbFe0QBd5nJqg@mail.gmail.com","threadId":"56348","inReplyTo":null,"subject":"Get tree of remote repository using custom ssh library.","fromName":"Stef Bon","fromEmail":"stefbon@gmail.com","sentAt":"2021-08-22T18:47:18Z","receivedAt":"2021-08-22T18:47:35Z","isPatch":false,"sender":{"key":"stefbon@gmail.com","avatar":null},"body":"Hi,\n\nI want to add git support to my fuse workspace, enable browsing of the\nusers repositories.\nI've got a custom ssh library:\n\nstruct ssh_channel_s *channel=create_channel(session, _CHANNEL_TYPE_SESSION);\nif (channel==NULL) return -1;\nset_channel_exec(channel, command);\n\nif (add_channel(channel, CHANNEL_FLAG_OPEN)==-1) goto free;\n\nif (send_channel_start_command_message(channel, 1, &seq)>0) {\n     struct ssh_payload_s *payload=NULL;\n\n      payload=get_ssh_payload_channel(channel, &expire, &seq, &error);\n\n      if (payload && payload->type==SSH_MSG_CHANNEL_DATA) {\n\n.... process the received data\n      }\n      free_payload(&payload);\n}\n\nNow I read:\n\nhttps://git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols\nand\nhttps://www.git-scm.com/docs/protocol-v2\n\nHow can I get remote repositories of a user on a server (say\ngithub.com, user stefbon) and browse each HEAD repository and the\nsource tree?\n\nStef Bon\n"},{"id":"433507","messageId":"CANXojcx=_Zvr3Und=as-Qeous5LRKnBEJ1zqjGYPFP0DyXNLHA@mail.gmail.com","threadId":"56348","inReplyTo":"CANXojcyX2uqAp5gLtfH8ffQFQBKkMoPqSzpDUnbFe0QBd5nJqg@mail.gmail.com","subject":"Re: Get tree of remote repository using custom ssh library.","fromName":"Stef Bon","fromEmail":"stefbon@gmail.com","sentAt":"2021-08-24T04:51:18Z","receivedAt":"2021-08-24T04:51:42Z","isPatch":false,"sender":{"key":"stefbon@gmail.com","avatar":null},"body":"ping\n"},{"id":"433711","messageId":"YSXY4WoB+Z1aayz4@alpha","threadId":"56348","inReplyTo":"CANXojcyX2uqAp5gLtfH8ffQFQBKkMoPqSzpDUnbFe0QBd5nJqg@mail.gmail.com","subject":"Re: Get tree of remote repository using custom ssh library.","fromName":"Kevin Daudt","fromEmail":"me@ikke.info","sentAt":"2021-08-25T05:45:05Z","receivedAt":"2021-08-25T05:53:40Z","isPatch":false,"sender":{"key":"me@ikke.info","avatar":"https://avatars.githubusercontent.com/u/135698?v=4"},"body":"On Sun, Aug 22, 2021 at 08:47:18PM +0200, Stef Bon wrote:\n> Hi,\n> \n> I want to add git support to my fuse workspace, enable browsing of the\n> users repositories.\n> I've got a custom ssh library:\n> \n> struct ssh_channel_s *channel=create_channel(session, _CHANNEL_TYPE_SESSION);\n> if (channel==NULL) return -1;\n> set_channel_exec(channel, command);\n> \n> if (add_channel(channel, CHANNEL_FLAG_OPEN)==-1) goto free;\n> \n> if (send_channel_start_command_message(channel, 1, &seq)>0) {\n>      struct ssh_payload_s *payload=NULL;\n> \n>       payload=get_ssh_payload_channel(channel, &expire, &seq, &error);\n> \n>       if (payload && payload->type==SSH_MSG_CHANNEL_DATA) {\n> \n> .... process the received data\n>       }\n>       free_payload(&payload);\n> }\n> \n> Now I read:\n> \n> https://git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols\n> and\n> https://www.git-scm.com/docs/protocol-v2\n> \n> How can I get remote repositories of a user on a server (say\n> github.com, user stefbon) and browse each HEAD repository and the\n> source tree?\n> \n> Stef Bon\n\nHello Stef,\n\nGit has no way of knowing what repositories might exist on a\ngiven server. They might live everywhere, and git does not keep track of\nwhat repositories are created on a central location, so there is not\ncentral directory to query.\n\nBesides that, services like github do not let you remotely browse\nrepositories over SSH, they only allow you to run git-upload-pack /\ngit-receive-pack or equivalent to handle the git protocol.\n\nThe only way to programatically explore what is available remotely is to\nuse an API that exposes this information (most public git forges provide\none).\n\nHope this helps, Kevin\n"},{"id":"433714","messageId":"CANXojcyVGp0aXySZswzFtmWL=q17bP5Zz4Si-Gxb0rgx4TNjAg@mail.gmail.com","threadId":"56348","inReplyTo":"YSXY4WoB+Z1aayz4@alpha","subject":"Re: Get tree of remote repository using custom ssh library.","fromName":"Stef Bon","fromEmail":"stefbon@gmail.com","sentAt":"2021-08-25T06:54:22Z","receivedAt":"2021-08-25T06:54:36Z","isPatch":false,"sender":{"key":"stefbon@gmail.com","avatar":null},"body":"Op wo 25 aug. 2021 om 07:45 schreef Kevin Daudt <me@ikke.info>:\n>\n\nHello Kevin,\n\n> >\n>\n> Hello Stef,\n>\n> Git has no way of knowing what repositories might exist on a\n> given server. They might live everywhere, and git does not keep track of\n> what repositories are created on a central location, so there is not\n> central directory to query.\n>\n\nOk.\n\n> Besides that, services like github do not let you remotely browse\n> repositories over SSH, they only allow you to run git-upload-pack /\n> git-receive-pack or equivalent to handle the git protocol.\n>\nThat is exactly what I want. I know git works with the git-upload-pack\nand git-receive-pack methods. I think I had to be more precisely.\nNow my issue is how do I have to call these, with what parameters to\nachieve the listing of entries?\n(git_tree and git_tree_entry for example?? I do not know)\n\nStef\n"}]}