v2

latestOpenAPI 3.0.02026-08-013312111.4 MB
Commits

Compare two commit diff stats

Produces a response in JSON format with a record for every path modified, including information on the type of the change and the number of lines added and removed.

Single commit spec

If the spec argument to this API is a single commit, the diff is produced against the first parent of the specified commit.

Two commit spec

Two commits separated by .. may be provided as the spec, e.g., 3a8b42..9ff173. When two commits are provided and the topic query parameter is true, this API produces a 2-way three dot diff. This is the diff between source commit and the merge base of the source commit and the destination commit. When the topic query param is false, a simple git-style diff is produced.

The two commits are interpreted as follows:

  • First commit: the commit containing the changes we wish to preview
  • Second commit: the commit representing the state to which we want to compare the first commit
  • Note: This is the opposite of the order used in git diff.
get/repositories/{workspace}/{repo_slug}/diffstat/{spec}

Response

The diff stats

sizeinteger

Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.

pageinteger

Page number of the current results. This is an optional element that is not provided in all responses.

pageleninteger

Current number of objects on the existing page. The default value is 500 with 5000 being the maximum allowed value.

nextstring uri

Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.

previousstring uri

Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.