File: generate_changelog.py

package info (click to toggle)
autofdo 0.19-2
  • links: PTS
  • area: main
  • in suites: bullseye, sid
  • size: 1,248,592 kB
  • sloc: cpp: 436,213; java: 108,653; objc: 108,251; ansic: 77,107; python: 45,387; cs: 24,942; sh: 16,011; php: 15,368; ruby: 6,255; makefile: 5,807; xml: 2,571; pascal: 388; lisp: 182
file content (66 lines) | stat: -rwxr-xr-x 1,559 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env python

"""Generates a friendly list of changes per language since the last release."""

import sys
import os

class Language(object):
  def __init__(self, name, pathspec):
    self.name = name
    self.pathspec = pathspec

languages = [
  Language("C++", [
      "':(glob)src/google/protobuf/*'",
      "src/google/protobuf/compiler/cpp",
      "src/google/protobuf/io",
      "src/google/protobuf/util",
      "src/google/protobuf/stubs",
  ]),
  Language("Java", [
      "java",
      "javanano",
      "src/google/protobuf/compiler/cpp",
  ]),
  Language("Python", [
      "javanano",
      "src/google/protobuf/compiler/python",
  ]),
  Language("JavaScript", [
      "js",
      "src/google/protobuf/compiler/js",
  ]),
  Language("PHP", [
      "php",
      "src/google/protobuf/compiler/php",
  ]),
  Language("Ruby", [
      "ruby",
      "src/google/protobuf/compiler/ruby",
  ]),
  Language("Csharp", [
      "csharp",
      "src/google/protobuf/compiler/csharp",
  ]),
  Language("Objective C", [
      "objectivec",
      "src/google/protobuf/compiler/objectivec",
  ]),
]

if len(sys.argv) < 2:
  print("Usage: generate_changelog.py <previous release>")
  sys.exit(1)

previous = sys.argv[1]

for language in languages:
  print(language.name)
  sys.stdout.flush()
  os.system(("git log --pretty=oneline --abbrev-commit %s...HEAD %s | " +
             "sed -e 's/^/ - /'") % (previous, " ".join(language.pathspec)))
  print("")

print("To view a commit on GitHub: " +
      "https://github.com/google/protobuf/commit/<commit id>")