blob: ac8cf47781023b514f8d30c792db9fa40263ce5c [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
Dave Wallace3c119f82019-04-18 10:08:07 -04007starttag = '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
Dave Wallaced5ae97c2018-01-24 00:51:22 -050012for root, dirnames, filenames in os.walk('.'):
13 for filename in fnmatch.filter(filenames, '*.api'):
14 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:
17 commits = subprocess.check_output(['git', 'log',
18 '--oneline', starttag + '..' + endtag,
19 f])
20 if commits:
Chris Luke159fcf42018-04-24 00:02:37 -040021 if f[0:2] == './':
22 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"\|")
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 Luke159fcf42018-04-24 00:02:37 -040034 else:
Paul Vinciguerra57783ef2019-07-02 17:37:46 -040035 print(f)
36 print(commits)