# collect.py -rw-r--r-- 439 bytes View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python

import sys
import requests

endpoint = 'https://gitlab.freedesktop.org'
project_id = '12103'

mrs = set()
for line in sys.stdin:
	hash = line.rstrip('\n')
	r = requests.get('{}/api/v4/projects/{}//repository/commits/{}/merge_requests'.format(endpoint, project_id, hash))
	for mr in r.json():
		if mr['id'] in mrs:
			continue
		mrs.add(mr['id'])

		print('!{} {} ({})'.format(mr['iid'], mr['title'], mr['web_url']))
# usage.sh -rw-r--r-- 52 bytes View raw
                                                                                
1
git log --pretty="format:%H" 0.14.0.. | ./collect.py