eiriksm/git-log-format

此包已被弃用,不再维护。作者建议使用violinist-dev/git-log-format包代替。
此包的最新版本(1.0.0)没有可用的许可证信息。

格式化类似changelog的git日志

1.0.0 2019-01-29 20:52 UTC

This package is not auto-updated.

Last update: 2019-02-20 21:12:17 UTC


README

Build Status Coverage Status Violinist enabled

这是一个方便的包,用于获取git log --oneline输出的格式化版本。

这是为Violinist.io消息中的changelog提供动力的部分。

安装

composer require violinist-dev/git-log-format

使用

从git log获取某种字符串输出。以下是一个命令行方法:

git log abababa..fefefef --oneline

在上面的例子中,abababa和fefefef都是提交历史中的哈希。

输出可能如下所示:

fefefef Fix bugs and add tests
cdcdcdc Release features and probably introduce bugs

然后,将输出传递给此包

$data = \Violinist\GitLogFormat\ChangeLogData::createFromString('fefefef Fix bugs and add tests
cdcdcdc Release features and probably introduce bugs');
// Now add some info about what the source of the log is. Like so:
$data->setGitSource('https://github.com/myname/mypackage');
// Then get convenient output back, with links to the actual commits:
print $data->getAsMarkdown();
// Prints:
// - [fefefef](https://github.com/myname/mypackage/commit/fefefef) Fix bugs and add tests
// - [cdcdcdc](https://github.com/myname/mypackage/commit/cdcdcdc) Release features and probably introduce bugs