I can see how to diff a specific commit using a url of the format
https://api.bitbucket.org/2.0/repositories/{username}/{repo_slug}/diff/<commit1>..<commit2>
and between two different branches this appears to work. However, when comparing two commits from the same branch, it only appears to diff the changes made by commit2.
Ideally I want the equivalent of running
$git diff <commit1> <commit2>
from the command line.
Any pointers would be most welcome.
Hello @Claire Petley,
The diff REST endpoint you referred to generates a 3-way diff in case you pass a revspec of 2 commits (e.g. aaa..bbb): it shows the changes introduced by the left ref (aaa) as compared against the right ref (bbb).
So assuming that aaa is actually an ancestor of bbb (e.g. they're "on the same branch") you can see the diff introduced by all commits between them including bbb, you need to use the following revspec bbb..aaa. The result will be similar to the output of git diff aaa bbb.
Hope this helps. Let me know if you have any questions.
Cheers,
Daniil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.