From: Kevin Daudt <me@ikke.info>
To: Stef Bon <stefbon@gmail.com>
Cc: Git Users <git@vger.kernel.org>
Subject: Re: Get tree of remote repository using custom ssh library.
Date: Wed, 25 Aug 2021 07:45:05 +0200 [thread overview]
Message-ID: <YSXY4WoB+Z1aayz4@alpha> (raw)
In-Reply-To: <CANXojcyX2uqAp5gLtfH8ffQFQBKkMoPqSzpDUnbFe0QBd5nJqg@mail.gmail.com>
On Sun, Aug 22, 2021 at 08:47:18PM +0200, Stef Bon wrote:
> 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
next prev parent reply other threads:[~2021-08-25 5:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-22 18:47 Get tree of remote repository using custom ssh library Stef Bon
2021-08-24 4:51 ` Stef Bon
2021-08-25 5:45 ` Kevin Daudt [this message]
2021-08-25 6:54 ` Stef Bon
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=YSXY4WoB+Z1aayz4@alpha \
--to=me@ikke.info \
--cc=git@vger.kernel.org \
--cc=stefbon@gmail.com \
/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