Commits

Returns commits from the repository

Returns the commits from the repository.
Required scopes: WORKSPACE, REPOSITORY_READ

Resource URL

GET
/workspaces/:domain/projects/:project_name/repository/commits

URL Parameters

Name Description
domain Required String The workspace domain.
project_name Required String The name ID of the project.

GET Parameters

Name Description
author String Filters the commits by their author.
page Integer The number of the successive page (results are splitted by pages of per_page elements each).
path String Filters the commits by contained changes to the path.
per_page Integer The number of returned elements on the page.
revision String SHA or branch/tag to start listing commits from. Default: the repository’s default branch (usually master).
since ISO 8601 Date in GMT Only commits after this date will be returned.
until ISO 8601 Date in GMT Only commits before this date will be returned.

Example

Request
GET
https://api.buddy.works/workspaces/buddy/projects/company-website/repository/commits?since=2016-01-01T00:00:00&until=2016-01-31T00:00:00&page=1&per_page=2
Sample Response
Status: 200 OK
X-Rate-Limit-Limit: 1
X-Rate-Limit-Remaining: 999
{
  "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/repository/commits",
  "html_url": "https://app.buddy.works/buddy/company-website/repository/commits",
  "commits": [
    {
      "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/repository/commits/506a3963507943d6908154f4bc9646e829128a08",
      "html_url": "https://app.buddy.works/buddy/company-website/repository/commit/506a3963507943d6908154f4bc9646e829128a08",
      "revision": "506a3963507943d6908154f4bc9646e829128a08",
      "author_date": "2016-01-19T12:36:33Z",
      "commit_date": "2016-01-19T12:36:33Z",
      "message": "init repo\n",
      "committer": {
        "url": "https://api.buddy.works/workspaces/buddy/member/1",
        "html_url": "https://app.buddy.works/buddy/profile/1",
        "id": 1,
        "name": "Mike Benson",
        "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png",
        "title": "Creative director"
      },
      "author": {
        "url": "https://api.buddy.works/workspaces/buddy/member/1",
        "html_url": "https://app.buddy.works/buddy/profile/1",
        "id": 1,
        "name": "Mike Benson",
        "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png",
        "title": "Creative director"
      }
    }
  ]
}

Gets a single commit

Returns the commits from the repository for the specified revision.
Required scopes: WORKSPACE, REPOSITORY_READ

Resource URL

GET
/workspaces/:domain/projects/:project_name/repository/commits/:revision

URL Parameters

Name Description
domain Required String The workspace domain.
project_name Required String The name ID of the project.
revision Required String The commit for this revision will be returned.

Example

Request
GET
https://api.buddy.works/workspaces/buddy/projects/company-website/repository/commits/506a3963507943d6908154f4bc9646e829128a08
Sample Response
Status: 200 OK
X-Rate-Limit-Limit: 1
X-Rate-Limit-Remaining: 999
{
  "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/repository/commits/506a3963507943d6908154f4bc9646e829128a08",
  "html_url": "https://app.buddy.works/buddy/company-website/repository/commit/506a3963507943d6908154f4bc9646e829128a08",
  "revision": "506a3963507943d6908154f4bc9646e829128a08",
  "author_date": "2016-01-19T12:36:33Z",
  "commit_date": "2016-01-19T12:36:33Z",
  "message": "init repo\n",
  "stats": {
    "additions": 388,
    "deletions": 0,
    "total": 388
  },
  "files": [
    {
      "file_name": ".gitignore",
      "status": "ADDED",
      "additions": 3,
      "deletions": 0,
      "total": 3,
      "patch": "@@ -0,0 +1,3 @@\n+.idea/\n+.DS_Store\n+css/\n"
    }
  ],
  "committer": {
    "url": "https://api.buddy.works/workspaces/buddy/member/1",
    "html_url": "https://app.buddy.works/buddy/profile/1",
    "id": 1,
    "name": "Mike Benson",
    "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png",
    "title": "Creative director"
  },
  "author": {
    "url": "https://api.buddy.works/workspaces/buddy/member/1",
    "html_url": "https://app.buddy.works/buddy/profile/1",
    "id": 1,
    "name": "Mike Benson",
    "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png",
    "title": "Creative director"
  },
  "content_url": "https://api.buddy.works/workspaces/buddy/projects/company-website/repository/contents?revision=506a3963507943d6908154f4bc9646e829128a08"
}

status in file object can be either ADDED, MODIFIED, REPLACED, or DELETED

Compare two commits

Returns the changes between two points. The response from the API is equivalent to running the git log base...head command
Required scopes: WORKSPACE, REPOSITORY_READ

Resource URL

GET
/workspaces/:domain/projects/:project_name/repository/comparison/:base...:head

URL Parameters

Name Description
base Required String The revision before the first one from the returned list.
domain Required String The workspace domain.
head Required String The last revision in the returned list.
project_name Required String The name ID of the project.

GET Parameters

Name Description
page Integer The number of the successive page (results are splitted by pages of per_page elements each).
per_page Integer The number of returned elements on the page.

Example

Request
GET
https://api.buddy.works/workspaces/buddy/projects/company-website/repository/comparison/506a3963507943d6908154f4bc9646e829128a08...7c4786ffc65816bc3cd2418c3ceeb34134f4b03a
Sample Response
Status: 200 OK
X-Rate-Limit-Limit: 1
X-Rate-Limit-Remaining: 999
{
  "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/repository/comparison",
  "html_url": "https://app.buddy.works/buddy/company-website/repository/commits",
  "commits": [
    {
      "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/repository/commits/7c4786ffc65816bc3cd2418c3ceeb34134f4b03a",
      "html_url": "https://app.buddy.works/buddy/company-website/repository/commit/7c4786ffc65816bc3cd2418c3ceeb34134f4b03a",
      "revision": "7c4786ffc65816bc3cd2418c3ceeb34134f4b03a",
      "author_date": "2016-03-02T12:29:55Z",
      "commit_date": "2016-03-02T12:29:55Z",
      "message": "Added readme.md",
      "committer": {
        "url": "https://api.buddy.works/workspaces/buddy/member/1",
        "html_url": "https://app.buddy.works/buddy/profile/1",
        "id": 1,
        "name": "Mike Benson",
        "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png",
        "title": "Creative director"
      },
      "author": {
        "url": "https://api.buddy.works/workspaces/buddy/member/1",
        "html_url": "https://app.buddy.works/buddy/profile/1",
        "id": 1,
        "name": "Mike Benson",
        "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png",
        "title": "Creative director"
      }
    }
  ],
  "base_commit": {
    "url": "https://api.buddy.works/workspaces/buddy/projects/company-website/repository/commits/506a3963507943d6908154f4bc9646e829128a08",
    "html_url": "https://app.buddy.works/buddy/company-website/repository/commit/506a3963507943d6908154f4bc9646e829128a08",
    "revision": "506a3963507943d6908154f4bc9646e829128a08",
    "author_date": "2016-01-19T12:36:33Z",
    "commit_date": "2016-01-19T12:36:33Z",
    "message": "init repo\n",
    "committer": {
      "url": "https://api.buddy.works/workspaces/buddy/member/1",
      "html_url": "https://app.buddy.works/buddy/profile/1",
      "id": 1,
      "name": "Mike Benson",
      "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png",
      "title": "Creative director"
    },
    "author": {
      "url": "https://api.buddy.works/workspaces/buddy/member/1",
      "html_url": "https://app.buddy.works/buddy/profile/1",
      "id": 1,
      "name": "Mike Benson",
      "avatar_url": "https://app.buddy.works/image-server/user/0/0/0/0/0/0/1/d643744fbe5ebf2906a4d075a5b97110/w/32/32/AVATAR.png",
      "title": "Creative director"
    }
  },
  "ahead": 0,
  "behind": 1
}