def get_commit_messages_since(self, version):
"""Return a formatted list of commit messages since the given tagged version."""
tag = '{}.{}.{}'.format(*version)
output = util.communicate([
'git', 'log',
'--pretty=format:{{{{%w(0,0,0)%s %b}}}}',
'--reverse', tag + '..'
])
# Split the messages, they are bounded by {{{{ }}}}
messages = []
for match in self.COMMIT_MSG_RE.finditer(output):
messages.append(match.group(1).strip())
# Wrap the messages
wrapper = TextWrapper(initial_indent='- ', subsequent_indent=' ')
messages = list(map(lambda msg: '\n'.join(wrapper.wrap(msg)), messages))
return '\n\n'.join(messages) + '\n'
评论列表
文章目录