`shift` is a Haskell library and executable that allow you to generate a changelog by inspecting the history of a Git repository.
This project is somewhat a prototype, and mainly works if the repository being used meets the following criteria:
This project is currently a prototype, and mainly works if you project meets
the following criteria:
- It's Git.
- Commits follow the [Conventional Commits](https://www.conventionalcommits.org) spec or the [Angular Commit Convention](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-format).
- Version tags (vX.X.X.X, vX.X.X, and others).
- It's hosted on a GitLab instance or GitHub, if links to commits and authors are desired.
- It is on Git.
- Commits follow the Angular commit convention.
- Numeric tags (vX.X.X.X, vX.X.X, and others).
- For URLs to authors and commits, it will need to be hosted on GitHub.
The `shift` executable generates changelogs in Markdown. However, the underlying data structure can be accessed on the library version for custom processing.
If it does, you can build and install this project using Stack:
## Installing
You can build and install this project using Stack:
```
stack build --copy-bins
```
## Usage
Once `shift`, is in your `PATH`, you can invoke it according to where your
To generate a `CHANGELOG` file, use: `shift -t git generate --output-path CHANGELOG`.
### Options
| Name | Description | Example |
| --- | --- | --- |
| `--output-path` | Writes the generated chagelog to the specified path. Note: The path will be overwritten one every run. | - |
| `--include-head` | Whether to include `HEAD` as a version in the changelog. Useful for tracking changes for the next tag. | - |
| `--from-ref` | The starting point of the changelog. If `--to-ref` is also specified, the changelog will be generated from the diff between these two refs. | `v1.0.1` |
| `--to-ref` | The end point of the changelog. If `--from-ref` is also specified, the changelog will be generated from the diff between these two refs. | `v1.0.1` |
### Built-in Server
`shift` also has a built-in web server for quickly previewing changes. Every refresh causes the changelog to be regenerated.
To save to a `CHANGELOG.md` file: `shift generate -t git > CHANGELOG.md`.
Navigate to http://localhost:3000 to view the changelog.
## TODO
By default, it will be rendered to HTML. A `as_markdown=true` query string param can be specified to view the changelog as Markdown: http://localhost:3000?as_markdown=true
A lot.
#### Options
- Other hosting types: Phabricator, BitBucket.
- Support more commit conventions.
- Templates.
- Releases.
| Name | Description | Example |
| --- | --- | --- |
| `--port` | The port to start the HTTP listener in. Defaults to `3000` if not provided. | `4000` |