X-Git-Url: https://mudpy.org/gitweb?a=blobdiff_plain;f=bin%2Fgit2gch;h=8956141081fe13484e32fdc189660a9b43821119;hb=5f1f5e63a6be65b0226b065576fddf464346e8da;hp=70a8de6ae7f34d704b5bc555fa14fbe58d9dcb81;hpb=45872cb13fa8724ade12b25068f1078f75066005;p=mudpy.git diff --git a/bin/git2gch b/bin/git2gch index 70a8de6..8956141 100755 --- a/bin/git2gch +++ b/bin/git2gch @@ -1,13 +1,14 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -u"""Generates potential ChangeLog file contents from commit messages.""" +"""Generates potential ChangeLog file contents from commit messages.""" -# Copyright (c) 2010 Jeremy Stanley . Permission +# Copyright (c) 2010-2011 Jeremy Stanley . Permission # to use, copy, modify, and distribute this software is granted under # terms provided in the LICENSE file distributed with this software. # needs GitPython: http://gitorious.org/git-python -import git, time +import git +import time copyright = """\ Copyright (c) 2004-2010 Jeremy Stanley . Permission to @@ -28,15 +29,17 @@ End:\ generated = "" for commit in git.Repo().log(): - header = "%s %s <%s>" % ( - time.strftime("%Y-%m-%d %H:%M:%S UTC", commit.authored_date), - commit.author.name, - commit.author.email - ) - comments = "" - for line in commit.message.split("\n")[1:]: - if line: line = "\t%s" % line - if line.startswith("\t*"): line = "\n%s" % line - comments += "%s\n" % line - generated += "%s\n%s\n" % ( header, comments) -print( "%s%s%s" % (generated, copyright, emacsinfo) ) + header = "%s %s <%s>" % ( + time.strftime("%Y-%m-%d %H:%M:%S UTC", commit.authored_date), + commit.author.name, + commit.author.email + ) + comments = "" + for line in commit.message.split("\n")[1:]: + if line: + line = "\t%s" % line + if line.startswith("\t*"): + line = "\n%s" % line + comments += "%s\n" % line + generated += "%s\n%s\n" % (header, comments) +print("%s%s%s" % (generated, copyright, emacsinfo))