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