diff options
author | David Paleino <dapal@debian.org> | 2011-11-10 01:18:23 +0100 |
---|---|---|
committer | David Paleino <dapal@debian.org> | 2011-11-10 01:18:23 +0100 |
commit | d0c5761e5bb0911f556ff18d6a72ca82a2d8a490 (patch) | |
tree | b4174653c7911272a86857ad13d5bcd1158f0b5d | |
parent | 3b8ef29ef34d7ea009faca1a35023b454ab2dce1 (diff) | |
download | bash-completion-d0c5761e5bb0911f556ff18d6a72ca82a2d8a490.tar.gz |
Commit make-changelog release helper
-rwxr-xr-x | extra/make-changelog.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/extra/make-changelog.py b/extra/make-changelog.py new file mode 100755 index 00000000..7bf99bcc --- /dev/null +++ b/extra/make-changelog.py @@ -0,0 +1,33 @@ +#!/usr/bin/python +# -*- encoding: utf-8 -*- + +import git +import sys +from collections import defaultdict +from textwrap import wrap +from email.Utils import formatdate + +repo = git.Repo('.') +start = git.Commit(repo, sys.argv[1]) +end = git.Commit(repo, 'HEAD') + + +curlog = repo.log(end) +oldlog = repo.log(start) + +changelog = defaultdict(list) + +for id in repo.commits_between(start, end): + commit = git.Commit(repo, id) + changelog[commit.author.name].append(commit.summary) + +print 'bash-completion (X.Y)' +print + +for author in sorted(changelog.keys()): + print " [ %s ]" % author + for log in changelog[author]: + print '\n'.join(wrap(log, initial_indent=' * ', subsequent_indent=' ')) + print + +print ' -- David Paleino <d.paleino@gmail.com> ', formatdate(localtime=True) |