5 import string, re, os, sys
8 fin = os.popen(
'git log --summary --stat --no-merges --date=short',
'r')
24 if string.find(line,
'commit') >= 0:
35 elif re.match(
'Author:', line) >=0:
36 authorList = re.split(
': ', line, 1)
37 author = authorList[1]
38 author = author[0:len(author)-1]
41 elif re.match(
'Date:', line) >= 0:
42 dateList = re.split(
': ', line, 1)
44 date = date[0:len(date)-1]
48 elif re.match(
' git-svn-id:', line) >= 0:
51 elif re.search(
'Signed-off-by', line) >= 0:
54 elif authorFound & dateFound & messageFound ==
False:
63 elif line[0:6] ==
' * ':
67 message = message + line.strip()
69 message = message +
" " + line.strip()
71 elif re.search(
'files changed', line) >= 0:
75 elif authorFound & dateFound & messageFound:
76 fileList = re.split(
' \| ', line, 2)
79 files = files +
", " + fileList[0].strip()
81 files = fileList[0].strip()
83 if authorFound & dateFound & messageFound & filesFound:
86 authorLine = date +
" " + author
87 if len(prevAuthorLine) == 0:
88 fout.write(authorLine +
"\n")
89 elif authorLine == prevAuthorLine:
92 fout.write(
"\n" + authorLine +
"\n")
96 commitLine =
"* " + files +
": " + message
99 while i < len(commitLine):
100 if len(commitLine) < i + 71:
101 commit = commit.rstrip() +
"\n\t" + commitLine[i:len(commitLine)]
103 index = commitLine.rfind(
' ', i, i+71)
105 commit = commit.rstrip() +
"\n\t" + commitLine[i:index]
108 commit = commit.rstrip() +
"\n\t" + commitLine[i:71]
112 fout.write(commit.rstrip() +
"\n")
122 prevAuthorLine = authorLine