Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Retrieving commit metadata via REST API

Yusef Ahmed
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 10, 2024

I am trying to create a Python script which given two Git hashes, it finds what commits occurred in between the two hashes. It then should get metadata regarding each commit found, such as the authors of the commit, the date & time, the files that were changed, etc.

Currently, my script locally uses Git CLI to do this, however its far too slow. Are there APIs I can use to speed this process up?

2 answers

1 vote
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 11, 2024

@Yusef Ahmed There are 4 REST API end-point to list commits: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commits-get

The response contains author, date, message and stuff, but it seems it may not contain the file list. If that's the case, you can get more details using this end-point:

https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commit-commit-get

(I don't see any "bulk get commit" operation though...)

0 votes
Gajesh Bhat July 10, 2024

Hello @Yusef Ahmed . Welcome to Bitbucket Community! You can use Bitbucket Cloud API to achieve this automation : https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events