Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/violinist-dev/git-log-format
Creates pretty readable changelog-like things from a git log (--oneline)
https://github.com/violinist-dev/git-log-format
composer composer-package drupal git github php
Last synced: 4 months ago
JSON representation
Creates pretty readable changelog-like things from a git log (--oneline)
- Host: GitHub
- URL: https://github.com/violinist-dev/git-log-format
- Owner: violinist-dev
- License: mit
- Created: 2017-07-21T14:26:36.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-11T15:40:56.000Z (5 months ago)
- Last Synced: 2024-10-12T03:24:12.359Z (4 months ago)
- Topics: composer, composer-package, drupal, git, github, php
- Language: PHP
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-log-format
[](https://packagist.org/packages/violinist-dev/git-log-format)
[](https://packagist.org/packages/violinist-dev/git-log-format)
[](https://coveralls.io/github/violinist-dev/git-log-format?branch=master)
[](https://violinist.io)A convenience package to get formatted versions of the output of git log --oneline.
This is part of what powers the changelogs in the messages from Violinist.io.
## Installation
```bash
composer require violinist-dev/git-log-format
```## Usage
Somehow get a string output from a git log. A command line way to do so is the following:
```bash
git log abababa..fefefef --oneline
```In the above example, abababa and fefefef are both hashes in the commit history.
The output would be somewhat like this:
```
fefefef Fix bugs and add tests
cdcdcdc Release features and probably introduce bugs```
Then, pass the output to this package:
```php
$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````