My use case is to get the commits after certain date. And I need it for both bitbucket server (API 1.0) and bitbucket cloud (API 2.0).
I came to know through api documentation that the commits api do not provide query parameters to filter the commits in a date range.
So I am thinking for a workaround to achieve this. The workaround will be to get the paginated results and check the commit date of last commit in the page. If commit date is less than the given date, stop calling the api for further commits.
But for this to work, the api should return the commits in "newest commits first" sort order. I checked the api response and found that the commits are in newest first order only.
In API 2.0, it is also written in the documentation that it returns all commits in the repo in topological order (newest commit first). While in API 1.0, it is not written so clearly.
As my workaround relies on sort order, my question is that is it guaranteed or not that this sort order (newest commit first) will not be changed in future for both API 1.0 and 2.0?
Api documentation links I referred to:
Bitbucket server API 1.0 : https://docs.atlassian.com/bitbucket-server/rest/7.1.1/bitbucket-rest.html#idp213
Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events