2 # -*- coding: utf-8 -*-
3 u"""Generates potential ChangeLog file contents from commit messages."""
5 # Copyright (c) 2010 Jeremy Stanley <fungi@yuggoth.org>. Permission
6 # to use, copy, modify, and distribute this software is granted under
7 # terms provided in the LICENSE file distributed with this software.
9 # needs GitPython: http://gitorious.org/git-python
14 Copyright (c) 2004-2010 Jeremy Stanley <fungi@yuggoth.org>. Permission to
15 use, copy, modify, and distribute this software is granted under terms
16 provided in the LICENSE file distributed with this software.
20 emacsinfo = "\f" + """
26 version-control: never
31 for commit in git.Repo().log():
32 header = "%s %s <%s>" % (
33 time.strftime("%Y-%m-%d %H:%M:%S UTC", commit.authored_date),
38 for line in commit.message.split("\n")[1:]:
41 if line.startswith("\t*"):
43 comments += "%s\n" % line
44 generated += "%s\n%s\n" % (header, comments)
45 print("%s%s%s" % (generated, copyright, emacsinfo))