eiriksm/ git-log-format
1.0.0
2019-01-29 20:52 UTC
Requires (Dev)
- phpunit/phpunit: ^6
- satooshi/php-coveralls: ^2.0
- squizlabs/php_codesniffer: ^3.4
This package is not auto-updated.
Last update: 2019-02-20 21:12:17 UTC
README
这是一个方便的包,用于获取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