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

On the command line, how can I use git to retrieve a list of pull requests and associated users?

David Cash September 18, 2019

I am hoping to gather some aggregated statistics relating to which user(s) have contributed various commits to any given branch, and which users have reviewed any given pull request.

On the command line, I can use "git log" to retrieve a list of commits to any given branch (such as develop/ which is the branch I am interested in). I can iterate this command line output and retrieve the commit hash, and the username / email who made the commit. 

After that, I can then use the Bitbucket website to view each pull request, but it's a manual process. Is there a git command that lists all pull requests similar to that found on the website under https://...../repos/...../pull-requests/ ?

Thank you very much for any assistance!

1 answer

0 votes
Joao Sgreccia
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 18, 2019

Hi @David Cash

Sorry for the late response.
Unfortunately, there isn't a git command to perform exactly what you are looking for.

However, it is possible to use bitbucket rest API to retrieve information about the pull request.

Pull request API:
https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests#get 

Querying pull requests:
https://developer.atlassian.com/bitbucket/api/2/reference/meta/filtering#query-pullreq

Authentication methods:
https://developer.atlassian.com/bitbucket/api/2/reference/meta/authentication

Please, do not hesitate to ask if you need any further assistance.

David Cash September 20, 2019

Thank you very much, your answer was very helpful

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events