git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Get tree of remote repository using custom ssh library.
@ 2021-08-22 18:47 Stef Bon
  2021-08-24  4:51 ` Stef Bon
  2021-08-25  5:45 ` Kevin Daudt
  0 siblings, 2 replies; 4+ messages in thread
From: Stef Bon @ 2021-08-22 18:47 UTC (permalink / raw)
  To: Git Users

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

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

* Re: Get tree of remote repository using custom ssh library.
  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
  1 sibling, 0 replies; 4+ messages in thread
From: Stef Bon @ 2021-08-24  4:51 UTC (permalink / raw)
  To: Git Users

ping

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

* Re: Get tree of remote repository using custom ssh library.
  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
  2021-08-25  6:54   ` Stef Bon
  1 sibling, 1 reply; 4+ messages in thread
From: Kevin Daudt @ 2021-08-25  5:45 UTC (permalink / raw)
  To: Stef Bon; +Cc: Git Users

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

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

* Re: Get tree of remote repository using custom ssh library.
  2021-08-25  5:45 ` Kevin Daudt
@ 2021-08-25  6:54   ` Stef Bon
  0 siblings, 0 replies; 4+ messages in thread
From: Stef Bon @ 2021-08-25  6:54 UTC (permalink / raw)
  To: Kevin Daudt, Stef Bon, Git Users

Op wo 25 aug. 2021 om 07:45 schreef Kevin Daudt <me@ikke.info>:
>

Hello Kevin,

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

Ok.

> 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.
>
That is exactly what I want. I know git works with the git-upload-pack
and git-receive-pack methods. I think I had to be more precisely.
Now my issue is how do I have to call these, with what parameters to
achieve the listing of entries?
(git_tree and git_tree_entry for example?? I do not know)

Stef

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

end of thread, other threads:[~2021-08-25  6:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-08-25  6:54   ` Stef Bon

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).