Curbing Cumbersome Changelog Conflicts
A tool that creates changelog entries and stores them as unique files to avoid merge conflicts in version control. When it's time to release, changelog publish
collects these files and appends them to your changelog file using a format based on Keep a Changelog 1.0.0.
Teams that keep an up-to-date changelog are often plagued by merge conflicts introduced by the CHANGELOG
file. This tool was inspired by GitLab's How we solved GitLab's CHANGELOG conflict crisis article and the README
over at KiloKilo/changelog.
mint install pg8wood/changelog-generator
swift build -c release
cp -f .build/release/changelog /usr/local/bin/changelog
- Create a directory in your project in which to store your unreleased changelog entries. By default, the tool looks in
./changelogs/unreleased
. This may be changed with the--directory <path>
option. - Create your changelog file if it doesn't exist. By default, the tool looks for
CHANGELOG.md
. Use the--changelog-filename <path>
option to customize. - Add
<!--Latest Release-->
to the top of your changelog file. This anchor helps the tool parse previous releases when using thepublish
subcommand. It is not rendered by Markdown viewers. See this project's changelog for an example. - If you'd like your changelog to contain a header before latest release, create
changelogs/header.md
(or use a custom markdown file and specify the--header <path>
option) and add your header text as Markdown. This project's changelog header is prepended to the changelog with each release.
To view all the available options, run $ changelog help
Changelog entries may be added interactively with your favorite text editor, or quick entries can be passed as command-line arguments.
changelog add "Add something cool" "And something boring"
### Added
- Add something cool
- And something boring
🙌 Created changelog entry at changelogs/unreleased/<uniqueFilename>.md
<entry-type> The type of changelog entry to create.
Valid entry types are add, change, deprecate, remove, fix, and security.
<text> A list of quoted strings separated by spaces to be recorded as a bulleted changelog entry.
If <text> is supplied, the --editor option is ignored and the changelog entry is created for you without opening an interactive text editor.
-d, --directory <path> A directory where unpublished changelog entries will be written to / read from as Markdown files. (default: changelogs/unreleased/)
-e, --editor <editor> A terminal-based text editor executable in your $PATH used to write your changelog entry with more precision than the default bulleted list of changes. (default: vim)
--version Show the version.
-h, --help Show help information.
$ changelog publish 1.0.0
## [1.0.0] - <release-date>
### Added
- Add something cool
- And something boring
### Changed
- Start following [Semantic Versioning](https://semver.org) properly
### Fixed
- Fix all of <guy who used to work here>'s bugs
Nice! CHANGELOG.md was updated. Congrats on the release! 🥳🍻
<version> The version number associated with the changelog entries to be published.
<release-date> A string representing the date the version was published. Format MM-dd-yyyy. (default: <today>)
-d, --directory <path> A directory where unpublished changelog entries will be written to / read from as Markdown files. (default: changelogs/unreleased/)
--dry-run Prints the changelog entries that would have been appended to the CHANGELOG and doesn't delete any files in changelogs/unreleased.
--changelog-filename <changelog-filename>
The CHANGELOG file to which the unreleased changelog entries will be prepended. (default: CHANGELOG.md)
-h, --header <path> A Markdown file containing optional header text that will be prepended to your changelog. (default: changelogs/header.md)
If the supplied file does not exist or is not readable, no text will be prepended to the changelog.
--help Show help information.
This project's changelog was generated by the changelog
tool!