git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Get tree of remote repository using custom ssh library.

From
Kevin Daudt <me@ikke.info>
Date
Aug 25, 2021, 05:45 UTC
Message-ID
<YSXY4WoB+Z1aayz4@alpha>
In-Reply-To
<CANXojcyX2uqAp5gLtfH8ffQFQBKkMoPqSzpDUnbFe0QBd5nJqg@mail.gmail.com>
On Sun, Aug 22, 2021 at 08:47:18PM +0200, Stef Bon wrote:
Show 35 quoted lines
> Hi,
> 
> I want to add git support to my fuse workspace, enable browsing of the
> users repositories.
> I've got a custom ssh library:
> 
> struct ssh_channel_s *channel=create_channel(session, _CHANNEL_TYPE_SESSION);
> if (channel==NULL) return -1;
> set_channel_exec(channel, command);
> 
> if (add_channel(channel, CHANNEL_FLAG_OPEN)==-1) goto free;
> 
> if (send_channel_start_command_message(channel, 1, &seq)>0) {
>      struct ssh_payload_s *payload=NULL;
> 
>       payload=get_ssh_payload_channel(channel, &expire, &seq, &error);
> 
>       if (payload && payload->type==SSH_MSG_CHANNEL_DATA) {
> 
> .... process the received data
>       }
>       free_payload(&payload);
> }
> 
> Now I read:
> 
> https://git-scm.com/book/en/v2/Git-Internals-Transfer-Protocols
> and
> https://www.git-scm.com/docs/protocol-v2
> 
> How can I get remote repositories of a user on a server (say
> github.com, user stefbon) and browse each HEAD repository and the
> source tree?
> 
> Stef Bon
Hello Stef,

Git has no way of knowing what repositories might exist on a given server. They might live everywhere, and git does not keep track of what repositories are created on a central location, so there is not central directory to query.

Besides that, services like github do not let you remotely browse repositories over SSH, they only allow you to run git-upload-pack / git-receive-pack or equivalent to handle the git protocol.

The only way to programatically explore what is available remotely is to use an API that exposes this information (most public git forges provide one).

Hope this helps, Kevin
Previous: Stef BonNext: Stef Bon
Message 3 of 4 in “Get tree of remote repository using custom ssh library.”
  1. Stef BonAug 22, 2021
  2. Stef BonAug 24, 2021
  3. Kevin DaudtAug 25, 2021
  4. Stef BonAug 25, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.