BitBucket get list of all contributors
Asked Answered
R

1

4

Is there a way using the BitBucket API to get a list of all commiters/contributors to a repository?

I know I can user git-shortlog for this purpose but would rather make an API call if possible.

Romanov answered 26/12, 2015 at 16:6 Comment(0)
S
1

No, we do not currently have that kind of data indexed, or available through the API.


If you want a fairly slow way, just clone the repo and compile it locally with something like:
$ git log --format="%ae" | sort | uniq -c

Then you can parse through the commits one-by-one for contributors

Sordid answered 28/12, 2015 at 18:56 Comment(4)
I have "solved" id by going over all commits and collecting authors ... it is not the fastest solution but it works. GitHub has a nice simple API call to solve this.Romanov
Yep, that'll do it. If you're going to do that though, it'll be way faster to just clone the repo and compile it locally with something like: $ git log --format="%ae" | sort | uniq -cSordid
I know, but I would like to obtain some BitBucket specific info, like author id, etc. I went ahead an did this, I store the last commit id so next time I stop as soon as I find the same commit id.Romanov
FWIW, you could still perform all this locally and use the API to resolve email addresses to Bitbucket accounts by hitting: api.bitbucket.org/2.0/users/[email protected]Sordid

© 2022 - 2024 — McMap. All rights reserved.