blob: 7433f542aaafe292947723ed4ce6ed32960e6287 [file] [log] [blame]
Paul Vinciguerra57783ef2019-07-02 17:37:46 -04001#!/usr/bin/env python3
2from __future__ import print_function
3import fnmatch
4import os
5import subprocess
Chris Luke159fcf42018-04-24 00:02:37 -04006
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02007starttag = "v19.08-rc0"
8endtag = "HEAD"
Chris Luke159fcf42018-04-24 00:02:37 -04009emit_md = True
Dave Wallaced5ae97c2018-01-24 00:51:22 -050010apifiles = []
Chris Luke159fcf42018-04-24 00:02:37 -040011
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020012for root, dirnames, filenames in os.walk("."):
13 for filename in fnmatch.filter(filenames, "*.api"):
Dave Wallaced5ae97c2018-01-24 00:51:22 -050014 apifiles.append(os.path.join(root, filename))
Chris Luke159fcf42018-04-24 00:02:37 -040015
Dave Wallaced5ae97c2018-01-24 00:51:22 -050016for f in apifiles:
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020017 commits = subprocess.check_output(
18 ["git", "log", "--oneline", starttag + ".." + endtag, f]
19 )
Dave Wallaced5ae97c2018-01-24 00:51:22 -050020 if commits:
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020021 if f[0:2] == "./":
Chris Luke159fcf42018-04-24 00:02:37 -040022 f = f[2:]
23 if emit_md:
Paul Vinciguerra57783ef2019-07-02 17:37:46 -040024 print("| @c %s ||" % f)
25 print("| ------- | ------- |")
Chris Luke159fcf42018-04-24 00:02:37 -040026 for line in commits.splitlines():
27 parts = line.strip().split()
28 commit = parts[0]
Paul Vinciguerra57783ef2019-07-02 17:37:46 -040029 message = b" ".join(parts[1:]).decode().replace("|", r"\|")
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020030 print(
31 "| [%s](https://gerrit.fd.io/r/gitweb?"
32 "p=vpp.git;a=commit;h=%s) | %s |" % (commit, commit, message)
33 )
Paul Vinciguerra57783ef2019-07-02 17:37:46 -040034 print()
Chris Luke159fcf42018-04-24 00:02:37 -040035 else:
Paul Vinciguerra57783ef2019-07-02 17:37:46 -040036 print(f)
37 print(commits)