projects
/
fdkaac.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update ChangeLog and git2changelog.py
[fdkaac.git]
/
git2changelog.py
diff --git
a/git2changelog.py
b/git2changelog.py
index 91be8c77d04504fa803a1fb702459a60a35e8b76..694e9baf3339f9c104705a889e74d8c2e4b7a012 100755
(executable)
--- a/
git2changelog.py
+++ b/
git2changelog.py
@@
-15,15
+15,19
@@
GITLOG_CMD = ['git','log','--date=short','--format={0}'.format(GITLOG_FMT)]
Commit = namedtuple('Commit', 'commit author date subject ref')
def parse_gitlog(stream):
Commit = namedtuple('Commit', 'commit author date subject ref')
def parse_gitlog(stream):
- re_decode_tag = re.compile(r'(?<=\()([^,)]+)')
+ re_decode_ref = re.compile(r'(?<=\()([^,)]+)')
+ re_strip_tag = re.compile(r'^tag: ')
commit = dict()
for line in stream:
fields = line.decode('utf-8').rstrip('\r\n').split(' ', 1)
if len(fields) == 2:
key, value = fields
if key == 'ref':
commit = dict()
for line in stream:
fields = line.decode('utf-8').rstrip('\r\n').split(' ', 1)
if len(fields) == 2:
key, value = fields
if key == 'ref':
- m = re_decode_tag.search(value)
- value = ' [{0}]'.format(m.group()) if m else ''
+ m = re_decode_ref.search(value)
+ if m:
+ value = ' [{0}]'.format(re_strip_tag.sub('', m.group()))
+ else:
+ value = ''
commit[key] = value
elif commit:
yield Commit(**commit)
commit[key] = value
elif commit:
yield Commit(**commit)
This page took
0.00887 seconds
and
4
git commands to generate.