protobuf
generate_changelog.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
3
"""Generates a friendly list of changes per language since the last release."""
4
5
import
sys
6
import
os
7
8
class
Language
(object):
9
def
__init__
(self, name, pathspec):
10
self.
name
= name
11
self.
pathspec
= pathspec
12
13
languages = [
14
Language
(
"C++"
, [
15
"':(glob)src/google/protobuf/*'"
,
16
"src/google/protobuf/compiler/cpp"
,
17
"src/google/protobuf/io"
,
18
"src/google/protobuf/util"
,
19
"src/google/protobuf/stubs"
,
20
]),
21
Language
(
"Java"
, [
22
"java"
,
23
"src/google/protobuf/compiler/java"
,
24
]),
25
Language
(
"Python"
, [
26
"python"
,
27
"src/google/protobuf/compiler/python"
,
28
]),
29
Language
(
"JavaScript"
, [
30
"js"
,
31
"src/google/protobuf/compiler/js"
,
32
]),
33
Language
(
"PHP"
, [
34
"php"
,
35
"src/google/protobuf/compiler/php"
,
36
]),
37
Language
(
"Ruby"
, [
38
"ruby"
,
39
"src/google/protobuf/compiler/ruby"
,
40
]),
41
Language
(
"Csharp"
, [
42
"csharp"
,
43
"src/google/protobuf/compiler/csharp"
,
44
]),
45
Language
(
"Objective C"
, [
46
"objectivec"
,
47
"src/google/protobuf/compiler/objectivec"
,
48
]),
49
]
50
51
if
len
(sys.argv) < 2:
52
print
(
"Usage: generate_changelog.py <previous release>"
)
53
sys.exit(1)
54
55
previous = sys.argv[1]
56
57
for
language
in
languages:
58
print
(language.name)
59
sys.stdout.flush()
60
os.system((
"git log --pretty=oneline --abbrev-commit %s...HEAD %s | "
+
61
"sed -e 's/^/ - /'"
) % (previous,
" "
.join(language.pathspec)))
62
print
(
""
)
63
64
print
(
"To view a commit on GitHub: "
+
65
"https://github.com/protocolbuffers/protobuf/commit/<commit id>"
)
generate_changelog.Language.name
name
Definition:
generate_changelog.py:10
generate_changelog.Language.pathspec
pathspec
Definition:
generate_changelog.py:11
generate_changelog.Language.__init__
def __init__(self, name, pathspec)
Definition:
generate_changelog.py:9
len
int len
Definition:
php/ext/google/protobuf/map.c:206
print
static unsigned char * print(const cJSON *const item, cJSON_bool format, const internal_hooks *const hooks)
Definition:
cJSON.c:1074
generate_changelog.Language
Definition:
generate_changelog.py:8
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:51