2

To be used in another external script, we need the list of repositories hosted in a git repository server. We have GitWeb also enabled on the server.

Any one know if GitWeb exposes some API through which we can get the list of repositories ? Like GitBlit RPC (http://gitblit.com/rpc.html like https://your.glitblit.url/rpc?req=LIST_REPOSITORIES) ?

Thanks.

skn
  • 21
  • 1

2 Answers2

1

In the bottom right corner there is a small button that reads: TXT You can get the list of projects there, for example:

For sourceware, the gitweb page: https://sourceware.org/git/

The TXT button links here: https://sourceware.org/git/?a=project_index

It should return a list of projects which are basically

<name of the git repository> <owner>

in plain text, perfectly parseable by script.

But if you want JSON, you'd have to convert it with something like this:

$ wget -q -O- "https://sourceware.org/git/?a=project_index" \
    | jq -R -n '[ inputs | split(" ")[0:2] | {"project": .[0], "owner": .[1]} ]'
Dharman
  • 30,962
  • 25
  • 85
  • 135
tuxillo
  • 411
  • 7
  • 7
0

No, from what I can see of the gitweb.cgi (from gitweb/gitweb.perl) implementation, there is no RPC API with JSON return messages.

This is only visible through the web page.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250