6

How to:

  1. Get all commits in a particular Merge Request.
  2. Get all users who committed in a particular Merge Request.
  3. No. of lines added/deleted/updated by a particular user in a Merge Request.

Can't find how to use Gitlab API(http://doc.gitlab.com/ce/api/) for getting all the above mentioned. Is there a way Gitlab API can help to get these directly or by introducing some sort of hack.

bastelflp
  • 6,818
  • 5
  • 27
  • 61
softvar
  • 16,589
  • 10
  • 48
  • 74

1 Answers1

1

For the first point, I think you are looking for this:

curl --header "PRIVATE-TOKEN: ****" "http://gitlab/api/v3/projects/:project_id:/merge_requests/:mr_id:/commits" 

the Second point can be found with the attribute author of

curl --header "PRIVATE-TOKEN: ****" "http://gitlab/api/v3/projects/:project_id:/merge_requests/:mr_id:

the last point is trickier, when you have the list of commit, you can get the diff

curl --header "PRIVATE-TOKEN: ****" "http://gitlab/api/v3/projects/:project_id:/repository/commits/:sha/diff
Frol
  • 106
  • 1
  • 5