A changelog generator.
Overview
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:
- It's Git.
- Commits follow the Conventional Commits spec or the Angular Commit Convention.
- 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.
The shift
executable generates changelogs in Markdown. However, the underlying data structure can be accessed on the library version for custom processing.
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
repository is hosted:
-
GitLab:
shift generate -t gitlab --gitlab-token XXX --gitlab-owner etcinit --gitlab-repository shift --gitlab-server https://gitlab.chromabits.com
-
GitHub:
shift generate -t github --github-token XXX --github-owner etcinit --github-repository shift
-
Local/Other:
shift generate -t git
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.
shift serve -t git
Navigate to http://localhost:3000 to view the changelog.
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
Options
Name | Description | Example |
---|---|---|
--port |
The port to start the HTTP listener in. Defaults to 3000 if not provided. |
4000 |