How do I filter list of commits from REST API v2

Referring to https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/{username}/{repo_slug}/commits, I’d like to be able to list commits after a particular date or commit hash. I have tried using the querystring since, created_on, date to no avail.

Any help is very much appreciated. Thanks.

3 Likes

Unfortunately, at this time it is not possible. Erik originally meant to implement this so I don’t think it’s out of the realm of possibility but I don’t want to make promises about future implementations.

Thanks @sfarley for the prompt response. So for now if i want to get a list of yesterday’s commits, I will have to page through the whole list of commits. This sounds terribly inefficient and may cause unnecessary loads on the Bitbucket Cloud server.

Do you foresee any other more efficient approach to achieving the same result?

It’d be the same load on our servers with or without filtering (the expensive part is walking the DAG from disk). The most efficient approach, by far, is to keep a local clone and pull the new commits. It’s guaranteed to be optimal at that point.

Thanks @sfarley
Cloning the repo is not possible in the PaaS that I am using as there is no local disk access. I hope you will consider adding the since/after/until/before params to filter. In the meanwhile, I will traverse the whole history from oldest to newest commits everytime I want to retrieve the latest commits via the REST API.

Add filtering by commiter and i will be more than happy.

Hi, any plan to implement this feature in the near future?

This would be nice to have. I’d rather not clone a big repository to get the list of commits.

Can we get this upvoted to be added? It was a feature in the v1 apis, and is pretty standard fare for git repos.

1 Like

I’m also running into this. Would be great to get this implemented.

1 Like

Hi, we are also waiting for this. Appreciate sharing any ETA on this.

+1 This is really a big lacking in the endpoint. Not only would it save the hassle for people using it, it would also save costs to atlassian in bandwidth and computation. Can’t believe 2 years after nobody took care of this

+1 This is really bad. For us it is common to request commits for some period of time and the need to list through multiple pages to find necessary period creates big delay for our service operation.

+1, this is a key filter param!

+1 this is very important

+1, absolute key filter, otherwise this is just a placeholder endpoint, no real use for bigger teams

Hi this is 2021, I am writing client for 2.0 and 1.0 had filter parameters since and until which are not working in 2.0 so what happened with this feature?

1 Like

Still this feature is not implemented for commits ??

Hi folks, please implement this, come on, there are a lot of requests from people. In bitbucket server you can just write since…until and it will give you a list of commits and here you can’t do this. Have you chosen the right system to get rid of in 2024?)))

Here we are 4 years after the original post and it’s still not possible to filter commits from the api? How is this acceptable?