在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:hulu/restfulgit开源软件地址:https://github.com/hulu/restfulgit开源编程语言:Python 100.0%开源软件介绍:RestfulGit: A Restful API for Git dataProvides a read-only restful interface for accessing data from Git repositories (local to the server). Modeled off the GitHub API for compatibility (see http://developer.github.com/v3/). Requires:
Optional:
The While the app can be run with Example installation, config and run:Assuming Mac.
Edit Create a virtual environment and install dependencies - assuming Pipenv:
otherwise set up a virtual enviroment using your favourite technique (if you choose to use a virtual environment) then run the usual Running the server on a development machine:
The The ConfigurationRestfulGit uses Flask's config system. See
-- All of these routes return JSON unless otherwise specified. For repositories within directories slashes should be replaced with CommitsRetrieves a list of commit objects (in plumbing format):
[
{
"sha": "f85df530d8413b0390364b291eb97d1cc5798dee",
"url": "http://localhost:5000/repos/restfulgit/git/commits/f85df530d8413b0390364b291eb97d1cc5798dee/",
"author": {
"date": "2013-05-20T23:11:30Z",
"name": "Rajiv Makhijani",
"email": "[email protected]"
},
"committer": {
"date": "2013-05-20T23:11:30Z",
"name": "Rajiv Makhijani",
"email": "[email protected]"
},
"tree": {
"url": "http://localhost:5000/repos/restfulgit/git/trees/4c392547aa3d644877f3b22e198a5caac99a69a3/",
"sha": "4c392547aa3d644877f3b22e198a5caac99a69a3"
},
"parents": [
{
"url": "http://localhost:5000/repos/restfulgit/git/commits/7b3f40ff9aba370a59732522420201b744297317/",
"sha": "7b3f40ff9aba370a59732522420201b744297317"
}
],
"message": "Renamed main api file, added production recommendation to README"
},
...
] Retrieves a specific commit object (plumbing format) given its SHA:
Retrieves a specific commit object (porcelain format) given a branch name, tag name, or commit SHA:
{
"sha": "07b9bf1540305153ceeb4519a50b588c35a35464",
"url": "http://localhost:5000/repos/restfulgit/commits/07b9bf1540305153ceeb4519a50b588c35a35464/",
"files": [
{
"filename": "api.py",
"status": "added",
"sha": "ae9d90706c632c26023ce599ac96cb152673da7c",
"raw_url": "http://localhost:5000/repos/restfulgit/raw/07b9bf1540305153ceeb4519a50b588c35a35464/api.py",
"contents_url": "http://localhost:5000/repos/restfulgit/contents/api.py?ref=07b9bf1540305153ceeb4519a50b588c35a35464",
"changes": 179,
"additions": 179,
"deletions": 0,
"patch": ...,
}
],
"stats": {
"additions": 179,
"deletions": 0,
"total": 179
},
"author": {
"date": "2013-02-24T13:25:46Z",
"name": "Rajiv Makhijani",
"email": "[email protected]"
},
"committer": {
"date": "2013-02-24T13:25:46Z",
"name": "Rajiv Makhijani",
"email": "[email protected]"
},
"parents": [],
"commit": {
"committer": {
"date": "2013-02-24T13:25:46Z",
"name": "Rajiv Makhijani",
"email": "[email protected]"
},
"author": {
"date": "2013-02-24T13:25:46Z",
"name": "Rajiv Makhijani",
"email": "[email protected]"
},
"url": "http://localhost:5000/repos/restfulgit/git/commits/07b9bf1540305153ceeb4519a50b588c35a35464/",
"tree": {
"url": "http://localhost:5000/repos/restfulgit/git/trees/6ca22167185c31554aa6157306e68dfd612d6345/",
"sha": "6ca22167185c31554aa6157306e68dfd612d6345"
},
"sha": "07b9bf1540305153ceeb4519a50b588c35a35464",
"parents": [],
"message": "Initial support for read-only REST api for Git plumbing"
}
} Retrieves a diff of the changes in a given commit (specified by branch name, tag name, or commit SHA):
Given two commits, retrieves as good a common ancestor commit as possible for a merge. If there is no common ancestor, returns
{
"committer": {
"date": "2013-02-24T13:25:46Z",
"name": "Rajiv Makhijani",
"email": "[email protected]"
},
"author": {
"date": "2013-02-24T13:25:46Z",
"name": "Rajiv Makhijani",
"email": "[email protected]"
},
"url": "http://localhost:5000/repos/restfulgit/git/commits/07b9bf1540305153ceeb4519a50b588c35a35464/",
"tree": {
"url": "http://localhost:5000/repos/restfulgit/git/trees/6ca22167185c31554aa6157306e68dfd612d6345/",
"sha": "6ca22167185c31554aa6157306e68dfd612d6345"
},
"sha": "07b9bf1540305153ceeb4519a50b588c35a35464",
"parents": [],
"message": "Initial support for read-only REST api for Git plumbing"
} BranchesRetrieves a list of branches:
[
{
"name": "master",
"commit": {
"url": "http://localhost:5000/repos/restfulgit/commits/7ad9ae851a4491ab55042bccbab24fc8d740aaea/",
"sha": "7ad9ae851a4491ab55042bccbab24fc8d740aaea"
}
},
...
] Retrieves a specific branch object:
{
"name": "master",
"url": "http://localhost:5000/repos/restfulgit/branches/master/",
"commit": {
"sha": "dc745192fba83adc48361c36f73d0c7b6e060ed3",
"url": "http://localhost:5000/repos/restfulgit/commits/dc745192fba83adc48361c36f73d0c7b6e060ed3/",
"committer": {
"date": "2014-05-09T18:38:19Z",
"name": "Chris Rebert",
"email": "[email protected]"
},
"author": {
"date": "2014-05-09T18:38:19Z",
"name": "Chris Rebert",
"email": "[email protected]"
},
"parents": [
{
"sha": "6c1626a0d07e4bcfdbee4a11c898199a6f7d07b6",
"url": "http://localhost:5000/repos/restfulgit/commits/6c1626a0d07e4bcfdbee4a11c898199a6f7d07b6/"
}
],
"commit": {
"sha": "dc745192fba83adc48361c36f73d0c7b6e060ed3",
"url": "http://localhost:5000/repos/restfulgit/git/commits/dc745192fba83adc48361c36f73d0c7b6e060ed3/",
"committer": {
"date": "2014-05-09T18:38:19Z",
"name": "Chris Rebert",
"email": "[email protected]"
},
"author": {
"date": "2014-05-09T18:38:19Z",
"name": "Chris Rebert",
"email": "[email protected]"
},
"tree": {
"url": "http://localhost:5000/repos/restfulgit/git/trees/3c02cb0f836416718a76d853583c3aae37c1dff7/",
"sha": "3c02cb0f836416718a76d853583c3aae37c1dff7"
},
"parents": [
{
"url": "http://localhost:5000/repos/restfulgit/commits/6c1626a0d07e4bcfdbee4a11c898199a6f7d07b6/",
"sha": "6c1626a0d07e4bcfdbee4a11c898199a6f7d07b6"
}
],
"message": "document commit-in-porcelain-format endpoint in README"
}
},
"_links": {
"self": "http://localhost:5000/repos/restfulgit/branches/master/"
}
} Retrieves a list of other branches that have been merged into the given branch:
[
{
"name": "ambiguous",
"commit": {
"sha": "1f51b91ac383806df9d322ae67bbad3364f50811",
"url": "http://localhost/repos/restfulgit/commits/1f51b91ac383806df9d322ae67bbad3364f50811/",
}
},
...
] Retrieves a list of commits that are unique to the branch (not in any other ref), sorted either chronologically or topologically:
{
"commits": [
{
"sha": "c655dffe0fed2a78dc5f38c1bc8e5628e2605017",
"url": "http://localhost/repos/my-project/commits/c655dffe0fed2a78dc5f38c1bc8e5628e2605017/",
"commit": {
"sha": "c655dffe0fed2a78dc5f38c1bc8e5628e2605017",
"url": "http://localhost/repos/example/git/commits/c655dffe0fed2a78dc5f38c1bc8e5628e2605017/",
"author": {...},
"committer": {...},
"message": "",
"parents": [...],
"tree": {...}
},
"author": {...},
"committer": {...},
"parents": [...]
},
...
]
} BlobsRetrieves a specific blob object:
{
"url": "http://localhost:5000/repos/restfulgit.git/git/blobs/0d20b6487c61e7d1bde93acf4a14b7a89083a16d/",
"sha": "0d20b6487c61e7d1bde93acf4a14b7a89083a16d",
"encoding": "utf-8",
"data": "*.pyc ",
"size": 6
} TreesRetrieves a specific tree object:
{
"url": "http://localhost:5000/repos/restfulgit.git/git/trees/4c392547aa3d644877f3b22e198a5caac99a69a3/",
"sha": "4c392547aa3d644877f3b22e198a5caac99a69a3",
"tree": [
{
"url": "http://localhost:5000/repos/restfulgit.git/git/blobs/0d20b6487c61e7d1bde93acf4a14b7a89083a16d/",
"sha": "0d20b6487c61e7d1bde93acf4a14b7a89083a16d",
"mode": "0100644",
"path": ".gitignore",
"type": "blob",
"size": 6
},
...
]
} TagsRetrieves a list of tags:
[
{
"name": "initial",
"url": "http://localhost:5000/repos/restfulgit/tags/initial/",
"commit": {
"url": "http://localhost:5000/repos/restfulgit/commits/07b9bf1540305153ceeb4519a50b588c35a35464/",
"sha": "07b9bf1540305153ceeb4519a50b588c35a35464"
}
},
...
] Retrieves a specific tag object by name:
{
"name": "initial",
"url": "http://localhost:5000/repos/restfulgit/tags/initial/",
"tag": {
"message": "initial commit\n",
"object": {
"sha": "07b9bf1540305153ceeb4519a50b588c35a35464",
"type": "commit",
"url": "http://localhost:5000/repos/restfulgit/git/commits/07b9bf1540305153ceeb4519a50b588c35a35464/"
},
"sha": "1dffc031c9beda43ff94c526cbc00a30d231c079",
"tag": "initial",
"tagger": {
"date": "2013-09-28T01:14:09Z",
"email": "[email protected]",
"name": "Chris Rebert"
},
"url": "http://localhost:5000/repos/restfulgit/git/tags/1dffc031c9beda43ff94c526cbc00a30d231c079/"
},
"commit": {
"author": {
"date": "2013-02-24T13:25:46Z",
"email": "[email protected]",
"name": "Rajiv Makhijani"
},
"commit": {
"author": {
"date": "2013-02-24T13:25:46Z",
"email": "[email protected]",
"name": "Rajiv Makhijani"
},
"committer": {
"date": "2013-02-24T13:25:46Z",
"email": "[email protected]",
"name": "Rajiv Makhijani"
},
"message": "Initial support for read-only REST api for Git plumbing",
"parents": [],
"sha": "07b9bf1540305153ceeb4519a50b588c35a35464",
"tree": {
"sha": "6ca22167185c31554aa6157306e68dfd612d6345",
"url": "http://localhost:5000/repos/restfulgit/git/trees/6ca22167185c31554aa6157306e68dfd612d6345/"
},
"url": "http://localhost:5000/repos/restfulgit/git/commits/07b9bf1540305153ceeb4519a50b588c35a35464/"
},
"committer": {
"date": "2013-02-24T13:25:46Z",
"email": "[email protected]",
"name": "Rajiv Makhijani"
},
"parents": [],
"sha": "07b9bf1540305153ceeb4519a50b588c35a35464",
"url": "http://localhost:5000/repos/restfulgit/commits/07b9bf1540305153ceeb4519a50b588c35a35464/"
}
} Retrieves a specific tag object by SHA:
{
"url": "http://localhost:5000/repos/restfulgit.git/git/tags/89571737c474fae7ea4c092b5ed94e4eccb11b2a/",
"object": {
"url": "http://localhost:5000/repos/restfulgit.git/git/commits/b6b05bb0f230b591d82fcc07d169b7453e04cf89/",
"sha": "b6b05bb0f230b591d82fcc07d169b7453e04cf89",
"type": "commit"
},
"sha": "89571737c474fae7ea4c092b5ed94e4eccb11b2a",
"tag": "v0.1",
"tagger": {
"date": "2013-09-13T04:00:28Z",
"name": "Rajiv Makhijani",
"email": "[email protected]"
},
"message": "this is our first release"
} RefsRetrieves a list of refs:
全部评论
专题导读
上一篇:wilsonmar/git-utilities: Shell scripts to work with git repos发布时间:2022-06-11下一篇:MobileTribe/commit-template-idea-plugin: Git commit template Plugin for IntelliJ发布时间:2022-06-11热门推荐
热门话题
阅读排行榜
|
请发表评论