GET /repositories/{workspace}/{repo_slug}/diffstat/{spec}
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
.
Servers
- https://api.bitbucket.org/2.0
Path parameters
Name | Type | Required | Description |
---|---|---|---|
spec |
String | Yes |
A commit SHA (e.g. |
repo_slug |
String | Yes |
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: |
workspace |
String | Yes |
This can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: |
Query parameters
Name | Type | Required | Description |
---|---|---|---|
renames |
Boolean | No |
Whether to perform rename detection, true if omitted. |
ignore_whitespace |
Boolean | No |
Generate diffs that ignore whitespace |
merge |
Boolean | No |
This parameter is deprecated. The 'topic' parameter should be used instead. The 'merge' and 'topic' parameters cannot be both used at the same time. If true, the source commit is merged into the destination commit, and then a diffstat from the destination to the merge result is returned. If false, a simple 'two dot' diffstat between the source and destination is returned. True if omitted. |
topic |
Boolean | No |
If true, returns 2-way 'three-dot' diff. This is a diff between the source commit and the merge base of the source commit and the destination commit. If false, a simple 'two dot' diff between the source and destination is returned. |
path |
String | No |
Limit the diffstat to a particular file (this parameter can be repeated for multiple paths). |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.