Gerrit query to get the list of delta commits between to commit SHA

422 views
Skip to first unread message

William

unread,
Apr 13, 2021, 2:38:35 PM4/13/21
to Repo and Gerrit Discussion
Hi

Is there any gerrit query/API to get the list of all the changes merged between two given commit SHA's in gerrit?

Thanks

William

unread,
Apr 14, 2021, 2:11:00 PM4/14/21
to Repo and Gerrit Discussion
I have traditionally used  "git log SHA1..SHA2" but want to check if we can get this info via gerrit

Sven Selberg

unread,
Apr 15, 2021, 3:40:30 AM4/15/21
to Repo and Gerrit Discussion
I don't think there's one single queury for that but you could do a series of commit lookups and a change-query to get the result 
from SHA1-start to SHA1-end
commits.add GET /projects/$PROJECT/commits/$SHA-1-start
loop:
    commits.add GET /projects/$PROJECT/commits/$PARENT
    break if $PARENT == $SHA1-end

GET /changes/?=branch:$BRANCH+AND+project:$PROJECT+AND+(commit:$COMMIT for COMMIT in commits)


Thanks
Reply all
Reply to author
Forward
0 new messages