From a2e73644be95aad24693441e14644981e68f4d60 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Wed, 21 Sep 2016 14:39:27 -0700 Subject: [PATCH] Added convenient script for generating changelog draft. --- generate_changelog.py | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 generate_changelog.py diff --git a/generate_changelog.py b/generate_changelog.py new file mode 100755 index 0000000000..d7575d46c7 --- /dev/null +++ b/generate_changelog.py @@ -0,0 +1,65 @@ +#!/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 ") + sys.exit(1) + +previous = sys.argv[1] + +for language in languages: + print(language.name) + 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/")