blob: 7117ef8ff25f4a02306d2d3d5fe6e315d707d936 [file] [log] [blame]
Josh Habermana2e73642016-09-21 14:39:27 -07001#!/usr/bin/env python
Mike Kruskal0ab63a72022-10-26 20:10:29 -07002# Protocol Buffers - Google's data interchange format
3# Copyright 2008 Google Inc. All rights reserved.
4# https://developers.google.com/protocol-buffers/
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met:
9#
10# * Redistributions of source code must retain the above copyright
11# notice, this list of conditions and the following disclaimer.
12# * Redistributions in binary form must reproduce the above
13# copyright notice, this list of conditions and the following disclaimer
14# in the documentation and/or other materials provided with the
15# distribution.
16# * Neither the name of Google Inc. nor the names of its
17# contributors may be used to endorse or promote products derived from
18# this software without specific prior written permission.
19#
20# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Josh Habermana2e73642016-09-21 14:39:27 -070031
32"""Generates a friendly list of changes per language since the last release."""
33
34import sys
35import os
36
37class Language(object):
38 def __init__(self, name, pathspec):
39 self.name = name
40 self.pathspec = pathspec
41
42languages = [
43 Language("C++", [
44 "':(glob)src/google/protobuf/*'",
45 "src/google/protobuf/compiler/cpp",
46 "src/google/protobuf/io",
47 "src/google/protobuf/util",
48 "src/google/protobuf/stubs",
49 ]),
50 Language("Java", [
51 "java",
Adam Cozzettec8440a32018-05-24 15:56:09 -070052 "src/google/protobuf/compiler/java",
Josh Habermana2e73642016-09-21 14:39:27 -070053 ]),
54 Language("Python", [
Adam Cozzettec8440a32018-05-24 15:56:09 -070055 "python",
Josh Habermana2e73642016-09-21 14:39:27 -070056 "src/google/protobuf/compiler/python",
57 ]),
Josh Habermana2e73642016-09-21 14:39:27 -070058 Language("PHP", [
59 "php",
60 "src/google/protobuf/compiler/php",
61 ]),
62 Language("Ruby", [
63 "ruby",
64 "src/google/protobuf/compiler/ruby",
65 ]),
66 Language("Csharp", [
67 "csharp",
68 "src/google/protobuf/compiler/csharp",
69 ]),
70 Language("Objective C", [
71 "objectivec",
72 "src/google/protobuf/compiler/objectivec",
73 ]),
74]
75
76if len(sys.argv) < 2:
77 print("Usage: generate_changelog.py <previous release>")
78 sys.exit(1)
79
80previous = sys.argv[1]
81
82for language in languages:
83 print(language.name)
Josh Haberman277a8b62016-12-09 16:13:18 -080084 sys.stdout.flush()
Josh Habermana2e73642016-09-21 14:39:27 -070085 os.system(("git log --pretty=oneline --abbrev-commit %s...HEAD %s | " +
86 "sed -e 's/^/ - /'") % (previous, " ".join(language.pathspec)))
87 print("")
88
89print("To view a commit on GitHub: " +
Feng Xiaoafe98de2018-08-22 11:55:30 -070090 "https://github.com/protocolbuffers/protobuf/commit/<commit id>")