Josh Haberman | a2e7364 | 2016-09-21 14:39:27 -0700 | [diff] [blame] | 1 | #!/usr/bin/env python |
Mike Kruskal | 0ab63a7 | 2022-10-26 20:10:29 -0700 | [diff] [blame] | 2 | # 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 Haberman | a2e7364 | 2016-09-21 14:39:27 -0700 | [diff] [blame] | 31 | |
| 32 | """Generates a friendly list of changes per language since the last release.""" |
| 33 | |
| 34 | import sys |
| 35 | import os |
| 36 | |
| 37 | class Language(object): |
| 38 | def __init__(self, name, pathspec): |
| 39 | self.name = name |
| 40 | self.pathspec = pathspec |
| 41 | |
| 42 | languages = [ |
| 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 Cozzette | c8440a3 | 2018-05-24 15:56:09 -0700 | [diff] [blame] | 52 | "src/google/protobuf/compiler/java", |
Josh Haberman | a2e7364 | 2016-09-21 14:39:27 -0700 | [diff] [blame] | 53 | ]), |
| 54 | Language("Python", [ |
Adam Cozzette | c8440a3 | 2018-05-24 15:56:09 -0700 | [diff] [blame] | 55 | "python", |
Josh Haberman | a2e7364 | 2016-09-21 14:39:27 -0700 | [diff] [blame] | 56 | "src/google/protobuf/compiler/python", |
| 57 | ]), |
Josh Haberman | a2e7364 | 2016-09-21 14:39:27 -0700 | [diff] [blame] | 58 | 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 | |
| 76 | if len(sys.argv) < 2: |
| 77 | print("Usage: generate_changelog.py <previous release>") |
| 78 | sys.exit(1) |
| 79 | |
| 80 | previous = sys.argv[1] |
| 81 | |
| 82 | for language in languages: |
| 83 | print(language.name) |
Josh Haberman | 277a8b6 | 2016-12-09 16:13:18 -0800 | [diff] [blame] | 84 | sys.stdout.flush() |
Josh Haberman | a2e7364 | 2016-09-21 14:39:27 -0700 | [diff] [blame] | 85 | os.system(("git log --pretty=oneline --abbrev-commit %s...HEAD %s | " + |
| 86 | "sed -e 's/^/ - /'") % (previous, " ".join(language.pathspec))) |
| 87 | print("") |
| 88 | |
| 89 | print("To view a commit on GitHub: " + |
Feng Xiao | afe98de | 2018-08-22 11:55:30 -0700 | [diff] [blame] | 90 | "https://github.com/protocolbuffers/protobuf/commit/<commit id>") |