1# parse the git diff --stat output and created a reST list of
2# (significantly) changed files
3#
4# doc/develop.rst                                    |   2 +
5# doc/developer-guides/contribute_guidelines.rst     | 116 +++-
6# doc/developer-guides/hld/hld-devicemodel.rst       |   8 +-
7# doc/developer-guides/hld/hld-hypervisor.rst        |   1 +
8# doc/developer-guides/hld/hv-rdt.rst                | 126 ++--
9# doc/developer-guides/hld/ivshmem-hld.rst           |  70 ++
10# doc/developer-guides/hld/mmio-dev-passthrough.rst  |  40 ++
11# doc/developer-guides/hld/virtio-net.rst            |  42 +-
12# doc/developer-guides/hld/vuart-virt-hld.rst        |   2 +-
13# doc/getting-started/building-from-source.rst       |  39 +-
14
15
16function getLabel(filename)
17{
18   label="Label not found in " filename
19   while ((getline line < filename) > 0) {
20      # looking for first occurance of  .. _label name here:
21      if (match(line, /^\.\. _([^:]+):/, a) !=0) {
22         label=a[1]
23         break
24      }
25   }
26   close(filename)
27   return label
28}
29
30BEGIN {
31    if (changes < 1) {changes=10}
32    print "Showing docs in master branch with " changes " or more changes."
33}
34
35# print label for files with more than specified changed lines
36$3 >= changes {
37   lable=getLabel($1)
38   if (label !~ /^Label not/ ) { print "* :ref:`" label "`" }
39   else { print "* " substr($1,5) " was deleted." }
40}
41