简体   繁体   中英

Web API (like github REST API) for a personal Git server repo to enable “git log”?

I probably end up re-inventing parts of the github REST API for my own repo server. But maybe there is some server script to do that already out there? Or maybe you have other suggestions?

This is my use case:

I am developing a Firefox Extension, that shall display the data of a

git log -- <path>

I always could write a little server script that implements the well developed JGit and does the "git log" command there. But then, the FF extension depends on that server script ;(

I was wondering, if there exists something like the github REST API for "not-github"-repos that would be more standard as my little server script?

I also thought about a Git JS Client , like Git.JS (apparently the only JS Client; workes with node.js; Unfortunatly the project is no more active and has no documentation.) . However, I don't need a full client. I just want to retrieve some information Read Only from the remote master repo.

Although I am late to the party I have noticed a few a might contribute to the answer.

Orion Git API Orion is an Eclipse project

RESTFul Git from Hulu on github

If you haven't tried it, GitBlit is a VERY cool option. I have multiple installations on a few windows dedicated servers that I pull together using a REST API. I had it up and running in 5 minutes, in Windows, using the "GO: Single-Stack Solution".

Gitblit GO is an integrated, single-stack solution based on Jetty.

You do not need Apache httpd, Perl, Git, or Gitweb. Should you want to use some or all of those, you still can; Gitblit plays nice with the other kids on the block.

This is what you should download if you want to go from zero to Git in less than 5 mins.

I would say you definitely need to implement some kind of server-side code by your own.

You can choose any server-side language you like. I believe ruby or python will work fine. Than create simple web-site with one page embedding output of git log according to the parameters given.

All other options will not work for you, I believe. You cannot remotely access git repository's history due to distributed nature of git — you can read history of your local repository only.

Reading that web-page by your extension and parsing output will give you what you need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM