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: 1 day 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 (about 2 months ago)
- Last Synced: 2024-10-12T03:24:12.359Z (26 days 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
[![Packagist](https://img.shields.io/packagist/v/violinist-dev/git-log-format.svg?maxAge=3600)](https://packagist.org/packages/violinist-dev/git-log-format)
[![Packagist](https://img.shields.io/packagist/dt/violinist-dev/git-log-format.svg?maxAge=3600)](https://packagist.org/packages/violinist-dev/git-log-format)
[![Coverage Status](https://coveralls.io/repos/github/violinist-dev/git-log-format/badge.svg?branch=master)](https://coveralls.io/github/violinist-dev/git-log-format?branch=master)
[![Violinist enabled](https://img.shields.io/badge/violinist-enabled-brightgreen.svg)](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````