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
13 Copyright (c) 2004-2010 Jeremy Stanley <fungi@yuggoth.org>. Permission to
14 use, copy, modify, and distribute this software is granted under terms
15 provided in the LICENSE file distributed with this software.
19 emacsinfo = "\f" + """
25 version-control: never
30 for commit in git.Repo().log():
31 header = "%s %s <%s>" % (
32 time.strftime("%Y-%m-%d %H:%M:%S UTC", commit.authored_date),
37 for line in commit.message.split("\n")[1:]:
38 if line: line = "\t%s" % line
39 if line.startswith("\t*"): line = "\n%s" % line
40 comments += "%s\n" % line
41 generated += "%s\n%s\n" % ( header, comments)
42 print( "%s%s%s" % (generated, copyright, emacsinfo) )