Repository Manipulation
Get object history in a ref by its latest path
API Documentation
Repository Management
Repository Manipulation
- GETGet details of an existing repo.
- DELDelete a repo.
- POSTImport a Git repo into this Diversion repo
- POSTCheck if a git repo could be imported to Diversion
- POSTSync a Git repo to this Diversion repo
- GETGet file tree snapshot. Either one of workspace, branch or commit ID needs to be specified as ref ID.
- GETGet file tree snapshot for a nested tree path. Either one of workspace, branch or commit ID needs to be specified as ref ID.
- GETGet object history in a ref by its latest path
- GETGet file entry (either tree or blob). Either one of workspace, branch or commit ID needs to be specified.
- GETGet blob contents snapshot. Either one of workspace, branch or commit ID needs to be specified.
- GETGet blob contents using storage information, as retrieved from other APIs.
Repository Commit Manipulation
Repository Workspace Manipulation
- GETGet repos workspaces
- POSTCreate a workspace
- GETGet repos workspaces 1
- POSTUpdate workspace name
- POSTWorkspace checkout ref
- GETGet updates needed to be applied by the client to this workspace
- GETGet status of changes in workspace
- POSTReset changes in workspace
- POSTMerge base branch into workspace
- GETGet preferences of the current user
- PUTUpdate the preferences of the current user
- GETGet list of potential clashes with files in other users' workspaces and branches
Repository Branch Manipulation
Repository Tag Manipulation
Repository Shelves Manipulation
File Mutation
Repository Merge Manipulation
- GETDetails of a specific merge in progress
- POSTAfter all conflicts are resolved, finalizes the merge with a commit
- POSTClose an open merge without resolving it
- POSTAccepts a change from one of the branches (base or other)
- POSTUpdate a conflicting file, potentially resolving the conflict.
- GETRetrieve conflicted merges in this repo
- POSTMerge ref into a branch
Collaborators
Repository Content Comparison
Github App Integration
Repository Manipulation
Get object history in a ref by its latest path
GET
/
repos
/
{repo_id}
/
files
/
history
/
{ref_id}
/
{path}
curl --request GET \
--url https://api.diversion.dev/v0/repos/{repo_id}/files/history/{ref_id}/{path} \
--header 'Authorization: Bearer <token>'
{
"entries": [
{
"entry": {
"path": "hello.cc",
"prev_path": "<string>",
"status": 1,
"mode": 16877,
"mtime": "2023-11-07T05:31:56Z",
"blob": {
"storage_uri": "repo_id/2aae6c35c94fcfb415dbe95f408b9ce91ee846ed",
"storage_backend": 1,
"size": 123,
"sha": "<string>"
}
},
"commit": {
"commit_id": "example_id",
"created_ts": 123,
"commit_message": "<string>",
"branch_id": "<string>",
"author": {
"image": "<string>",
"email": "jsmith@example.com",
"full_name": "<string>",
"id": "<string>",
"name": "<string>"
},
"parents": [
"<string>"
]
}
}
]
}
Authorizations
This API uses OAuth 2 with the implicit grant flow
Path Parameters
The repo ID of the repository. Repo name can be used instead of the ID, but usage of ID for permanent linking and API requests is preferred.
Required string length:
3 - 128
An ID of a workspace, branch or commit.
Required string length:
3 - 128
A path to a file inside the repository.
Query Parameters
Limit the number or items returned from a listing api
Required range:
x > 1
Skip a number of items returned from a listing api
Required range:
x > 0
Response
200
application/json
List of changes in the history of a versioned file
One of: 1 - INTACT, 2 - ADDED, 3 - MODIFIED, 4 - DELETED
Available options:
1
, 2
, 3
, 4
The file mode (as Unix mode)
Available options:
16877
, 33188
, 33261
, 40960
Optional hint in case the item was renamed or moved
Coupled with storage_backend, a uri to storage location
One of: 1 - EFS, 2 - S3
Available options:
1
, 2
Size in bytes
Required string length:
3 - 128
Seconds since epoch UTC
The branch on which this commit was created
List of parent commits of this commit
curl --request GET \
--url https://api.diversion.dev/v0/repos/{repo_id}/files/history/{ref_id}/{path} \
--header 'Authorization: Bearer <token>'
{
"entries": [
{
"entry": {
"path": "hello.cc",
"prev_path": "<string>",
"status": 1,
"mode": 16877,
"mtime": "2023-11-07T05:31:56Z",
"blob": {
"storage_uri": "repo_id/2aae6c35c94fcfb415dbe95f408b9ce91ee846ed",
"storage_backend": 1,
"size": 123,
"sha": "<string>"
}
},
"commit": {
"commit_id": "example_id",
"created_ts": 123,
"commit_message": "<string>",
"branch_id": "<string>",
"author": {
"image": "<string>",
"email": "jsmith@example.com",
"full_name": "<string>",
"id": "<string>",
"name": "<string>"
},
"parents": [
"<string>"
]
}
}
]
}