Dave Wallace | d5ae97c | 2018-01-24 00:51:22 -0500 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | import os, fnmatch, subprocess |
Chris Luke | 159fcf4 | 2018-04-24 00:02:37 -0400 | [diff] [blame] | 3 | |
Marco Varlese | 5fcca2a | 2018-10-18 09:37:17 +0200 | [diff] [blame] | 4 | starttag = 'v18.10-rc0' |
| 5 | endtag = 'v18.10' |
Chris Luke | 159fcf4 | 2018-04-24 00:02:37 -0400 | [diff] [blame] | 6 | emit_md = True |
Dave Wallace | d5ae97c | 2018-01-24 00:51:22 -0500 | [diff] [blame] | 7 | apifiles = [] |
Chris Luke | 159fcf4 | 2018-04-24 00:02:37 -0400 | [diff] [blame] | 8 | |
Dave Wallace | d5ae97c | 2018-01-24 00:51:22 -0500 | [diff] [blame] | 9 | for root, dirnames, filenames in os.walk('.'): |
| 10 | for filename in fnmatch.filter(filenames, '*.api'): |
| 11 | apifiles.append(os.path.join(root, filename)) |
Chris Luke | 159fcf4 | 2018-04-24 00:02:37 -0400 | [diff] [blame] | 12 | |
Dave Wallace | d5ae97c | 2018-01-24 00:51:22 -0500 | [diff] [blame] | 13 | for f in apifiles: |
| 14 | commits = subprocess.check_output(['git', 'log', |
| 15 | '--oneline', starttag + '..' + endtag, |
| 16 | f]) |
| 17 | if commits: |
Chris Luke | 159fcf4 | 2018-04-24 00:02:37 -0400 | [diff] [blame] | 18 | if f[0:2] == './': |
| 19 | f = f[2:] |
| 20 | if emit_md: |
| 21 | print "| @c %s ||" % f |
| 22 | print "| ------- | ------- |" |
| 23 | for line in commits.splitlines(): |
| 24 | parts = line.strip().split() |
| 25 | commit = parts[0] |
| 26 | message = " ".join(parts[1:]).replace("|", "\|") |
| 27 | print "| [%s](https://gerrit.fd.io/r/gitweb?" \ |
| 28 | "p=vpp.git;a=commit;h=%s) | %s |" % ( |
| 29 | commit, commit, message) |
| 30 | print |
| 31 | else: |
| 32 | print f |
| 33 | print commits |