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 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [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 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 12 | for root, dirnames, filenames in os.walk("."): |
| 13 | for filename in fnmatch.filter(filenames, "*.api"): |
Dave Wallace | d5ae97c | 2018-01-24 00:51:22 -0500 | [diff] [blame] | 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: |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 17 | commits = subprocess.check_output( |
| 18 | ["git", "log", "--oneline", starttag + ".." + endtag, f] |
| 19 | ) |
Dave Wallace | d5ae97c | 2018-01-24 00:51:22 -0500 | [diff] [blame] | 20 | if commits: |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 21 | if f[0:2] == "./": |
Chris Luke | 159fcf4 | 2018-04-24 00:02:37 -0400 | [diff] [blame] | 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"\|") |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 30 | print( |
| 31 | "| [%s](https://gerrit.fd.io/r/gitweb?" |
| 32 | "p=vpp.git;a=commit;h=%s) | %s |" % (commit, commit, message) |
| 33 | ) |
Paul Vinciguerra | 57783ef | 2019-07-02 17:37:46 -0400 | [diff] [blame] | 34 | print() |
Chris Luke | 159fcf4 | 2018-04-24 00:02:37 -0400 | [diff] [blame] | 35 | else: |
Paul Vinciguerra | 57783ef | 2019-07-02 17:37:46 -0400 | [diff] [blame] | 36 | print(f) |
| 37 | print(commits) |