violinist-dev / git-log-format
格式化类似变更日志的git日志
1.1.3
2024-09-11 15:40 UTC
Requires (Dev)
- php-coveralls/php-coveralls: ^2.2
- phpunit/phpunit: ^8 || ^9
- squizlabs/php_codesniffer: ^3.4
This package is auto-updated.
Last update: 2024-09-11 15:40:59 UTC
README
这是一个方便的包,可以获取git log --oneline的输出格式化版本。
这是Violinist.io消息中变更日志功能的一部分。
安装
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`