GET /snippets/{workspace}/{encoded_id}/{revision}/diff
Returns the diff of the specified commit against its first parent.
Note that this resource is different in functionality from the patch
resource.
The differences between a diff and a patch are:
- patches have a commit header with the username, message, etc
- diffs support the optional
path=foo/bar.py
query param to filter the diff to just that one file diff (not supported for patches) - for a merge, the diff will show the diff between the merge commit and its first parent (identical to how PRs work), while patch returns a response containing separate patches for each commit on the second parent's ancestry, up to the oldest common ancestor (identical to its reachability).
Note that the character encoding of the contents of the diff is unspecified as Git does not track this, making it hard for Bitbucket to reliably determine this.
Servers
- https://api.bitbucket.org/2.0
Path parameters
Name | Type | Required | Description |
---|---|---|---|
revision |
String | Yes |
A revspec expression. This can simply be a commit SHA1, a ref name, or a compare expression like |
encoded_id |
String | Yes |
The snippet id. |
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 |
---|---|---|---|
path |
String | No |
When used, only one the diff of the specified file will be returned. |
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.