[icinga-checkins] icinga.org: icinga-web/jmosshammer/default2: * License of changelog creator

git at icinga.org git at icinga.org
Mon Jul 19 10:36:01 CEST 2010


Module: icinga-web
Branch: jmosshammer/default2
Commit: 73a57d4d7013e64f96e049be20dd878baae2e231
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=73a57d4d7013e64f96e049be20dd878baae2e231

Author: Marius Hein <marius.hein at netways.de>
Date:   Fri Jun 25 13:57:18 2010 +0200

* License of changelog creator
* Honour the original from Marcus D. Hanwell

---

 bin/create-changelog.py |  148 ++++++++---------------------------------------
 1 files changed, 25 insertions(+), 123 deletions(-)

diff --git a/bin/create-changelog.py b/bin/create-changelog.py
index d474f29..3f36b27 100755
--- a/bin/create-changelog.py
+++ b/bin/create-changelog.py
@@ -1,16 +1,36 @@
 #!/usr/bin/python
-# Copyright 2010 Icinga Development Team
-# GPLv2
-# Author Marius
+#
+# create-changelog.py - Create changelogs from git commits
+# Copyright (C) 2010 Icinga Development Team
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+#
+# Author: Marius Hein <marius(dot)>hein(at)netways(dot)de>
+#
+# Idea was borrowed from:
+# http://blog.cryos.net/archives/202-Git-and-Automatic-ChangeLog-Generation.html
+# Copyright 2008 Marcus D. Hanwell <marcus at cryos.org>
+# Distributed under the terms of the GNU General Public License v2 or later
+#
 
 import string
 import re
 import os
-from pprint import PrettyPrinter
 from optparse import OptionParser
 
 reKey = re.compile('^(\w+):\s([^$]+)$')
-reLength = re.compile('\s\w*$')
 
 def parse_options():
 
@@ -114,123 +134,5 @@ def main():
 	fin.close()
 	exit(0)
 
-#	# Create a ChangeLog file in the current directory.
-#	fout = open(o.filename, 'w')
-#
-#	# Set up the loop variables in order to locate the blocks we want
-#	authorFound = False
-#	dateFound = False
-#	messageFound = False
-#	filesFound = False
-#	message = ""
-#	messageNL = False
-#	files = ""
-#	prevAuthorLine = ""
-#
-#	# The main part of the loop
-#	for line in fin:
-#		# The commit line marks the start of a new commit object.
-#		if string.find(line, 'commit') >= 0:
-#			# Start all over again...
-#			authorFound = False
-#			dateFound = False
-#			messageFound = False
-#			messageNL = False
-#			message = ""
-#			filesFound = False
-#			files = ""
-#			continue
-#		# Match the author line and extract the part we want
-#		elif re.match('Author:', line) >=0:
-#			authorList = re.split(': ', line, 1)
-#			author = authorList[1]
-#			author = author[0:len(author)-1]
-#			authorFound = True
-#		# Match the date line
-#		elif re.match('Date:', line) >= 0:
-#			dateList = re.split(':   ', line, 1)
-#			date = dateList[1]
-#			date = date[0:len(date)-1]
-#			dateFound = True
-#		# The svn-id lines are ignored
-#		elif re.match('    git-svn-id:', line) >= 0:
-#			continue
-#		# The sign off line is ignored too
-#		elif re.search('Signed-off-by', line) >= 0:
-#			continue
-#		# Extract the actual commit message for this commit
-#		elif authorFound & dateFound & messageFound == False:
-#			# Find the commit message if we can
-#			if len(line) == 1:
-#				if messageNL:
-#					messageFound = True
-#				else:
-#					messageNL = True
-#			elif len(line) == 4:
-#				messageFound = True
-#			else:
-#				if len(message) == 0:
-#					message = message + line.strip()
-#				else:
-#					message = message + " " + line.strip()
-#		# If this line is hit all of the files have been stored for this commit
-#		elif re.search('files changed', line) >= 0:
-#			filesFound = True
-#			continue
-#		# Collect the files for this commit. FIXME: Still need to add +/- to files
-#		elif authorFound & dateFound & messageFound:
-#			fileList = re.split(' \| ', line, 2)
-#			if len(fileList) > 1:
-#				if len(files) > 0:
-#					files = files + ", " + fileList[0].strip()
-#				else:
-#					files = fileList[0].strip()
-#		# All of the parts of the commit have been found - write out the entry
-#		if authorFound & dateFound & messageFound & filesFound:
-#			# First the author line, only outputted if it is the first for that
-#			# author on this day
-#			authorLine = date + "  " + author
-#			if len(prevAuthorLine) == 0:
-#				fout.write(authorLine + "\n")
-#			elif authorLine == prevAuthorLine:
-#				pass
-#			else:
-#				fout.write("\n\n" + authorLine + "\n")
-#
-#			# Assemble the actual commit message line(s) and limit the line length
-#			# to 80 characters.
-#			# commitLine = "* " + files + ": " + message
-#			commitLine = message
-#			i = 0
-#			commit = ""
-#			while i < len(commitLine):
-#				if len(commitLine) < i + 78:
-#					commit = commit + "\n " + commitLine[i:len(commitLine)]
-#					break
-#				index = commitLine.rfind(' ', i, i+78)
-#				if index > i:
-#					commit = commit + "\n  " + commitLine[i:index]
-#					i = index+1
-#				else:
-#					commit = commit + "\n  " + commitLine[i:78]
-#					i = i+79
-#
-#			# Write out the commit line
-#			fout.write(commit)
-#
-#			#Now reset all the variables ready for a new commit block.
-#			authorFound = False
-#			dateFound = False
-#			messageFound = False
-#			messageNL = False
-#			message = ""
-#			filesFound = False
-#			files = ""
-#			prevAuthorLine = authorLine
-#
-#	# Close the input and output lines now that we are finished.
-#	fin.close()
-#	fout.close()
-
 if __name__ == '__main__':
 	main()
\ No newline at end of file





More information about the icinga-checkins mailing list