commands.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:sublime-text-3-packages 作者: nickjj 项目源码 文件源码
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'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号