Git-cliff – Generate changelog from the Git history
A customizable changelog generator, git-cliff, is now in version 2.0. It supports regex parsers, config files, and conventional commits. Integration available for Rust, Python, and Node.js. Copyright spans 2021-2024.
Read original articleThe website introduces git-cliff, a highly customizable changelog generator now available in version 2.0. It offers customization through regex-powered parsers and a configuration file to match desired formats. The tool supports generating changelog files for Git repositories following conventional commits. It can be seamlessly integrated into Rust, Python, and Node.js projects as a command-line tool or used as a library for Rust projects. The website provides documentation, news, and community links for users interested in learning more or engaging with the git-cliff tool. Copyright for git-cliff is indicated from 2021 to 2024.
Related
Show HN: Sandcastle – a minimal, lightweight build tool and shell automator
SandCastle is a versatile lightweight build tool for various languages and shells. Users define tasks in a _castle.yaml_ file, supporting shells like bash and zsh. Installation offers pre-built binaries or source compilation for Windows, Linux, and MacOS.
Show HN: Qq: like jq, but can transcode between many formats
The GitHub repository hosts `qq`, a tool using `jq` query syntax and `gojq` for configuration format transcoding. It offers interactive query building, multiple format support, and encoding performance focus. Installation options include source or releases. Contributions welcome.
Show HN: Triplit – Open-source syncing database that runs on server and client
The GitHub URL provides details on `@changesets/cli`, a tool for versioning and publishing code in multi-package and single-package repositories. Full documentation and common questions are accessible in their repository.
Show HN: Glasskube – Open Source Kubernetes Package Manager, alternative to Helm
The GitHub repository for Glasskube, a Kubernetes package manager, offers a user-friendly CLI/UI, package management, secure updates, GitOps integration, reactions/comments, and support for private packages. It includes installation guides, architecture, support channels, and contribution guidelines.
Igneous Linearizer: semi-structured source code
The Igneous Linearizer project enhances source code in Obsidian Markdown format, enabling features like links and transclusion. It sacrifices AST correctness for compatibility with text editors and Git, benefiting literate programming. Users must follow specific input file formats for optimal use.
I have a program which generates the first draft of the rclone changelog from the first line of each git commit. I try to encourage all contributors to make the first line of their commit message be something a user would like to read in the changelog. Instead of `fixed nil pointer error` have `fixed crash when copying file to xyz backend`.
I also spend maybe an hour each release editing the auto generated changelog, removing the noise (refactored X, fixed docs for Y, made tests for Z work), condensing multiple entries, reorganizing, moving things to the correct section, linking stuff etc. Where the committer didn't write a sensible first line commit message I go back look at the diff and rewrite it.
I try to put the important things first in the changelog and keep it brief. The changelog is a heads-up for users that things have changed or been fixed and users don't want to spend hours reading it.
I think for an open source project like rclone where I review commits from all different levels of developer, and from all different levels of English mastery I'd have too much difficulty getting every commit message written in https://www.conventionalcommits.org/en/v1.0.0/ style to use a tool like git-cliff to generate the changelog without editing it.
Would I like not to spend an hour or more of my time editing the changelog for each release - most definitely! However I owe it to the users to make something nice and I don't think I can delegate that to a program.
> Using commit log diffs as changelogs is a bad idea: they're full of noise. Things like merge commits, commits with obscure titles, documentation changes, etc.
> The purpose of a commit is to document a step in the evolution of the source code. Some projects clean up commits, some don't.
> The purpose of a changelog entry is to document the noteworthy difference, often across multiple commits, to communicate them clearly to end users.
The things that make this work well for us are
- We make sure we document every PR with user facing language and conventional commits.
- We generally use GitHub's squash merge, which means the noisy development commits are not part of the changelog.
- We create a highlights doc when we release that summarizes the main points of the changelog (this is the distinction between a changelog and release notes). E.g. https://ratatui.rs/highlights/v027/
Hopefully this software is better but this seems like an opportune place to lodge this complaint.
Great work, git-cliff devs!
For an app to be useful you need to have a case where you want the data from the commit history to be useful in the context of a doc, where you retain technical descriptions written by devs. Just copying the commit descriptions into a doc, even in a nicer format, feels like theatre to me. You aren't gaining anything. Non-technical users won't benefit from it and everyone else can learn 'git log'.
There is an arguement that using this would push a dev team to improve their commits, but in my experience if the team lack enough discipline to write them well a time saving tool isn't enough to push them to get better. They're probably not writing a useful changelog yet, so this doesn't save any time at all.
I really hope I'm missing something.
If you follow this properly the commits will already have important metadata for presentation in a changelog.
Also keep in mind that the auto-generated changelog should always be augmented and filtered manually before the final release.
But the combination of git-cliff and conventional commits can save a lot of time for the initial draft.
It does require discipline in using conventional commits properly.
We do monthly releases, and the level of effort has been under an hour each month per dev, which has been super worth it for us.
I wrote a tool to validate commits, which helps ensure both the git history and changelog look clean: https://github.com/welpo/git-sumi
It’s impossible to rewind your brain to the time of when the change is made to consider the total impact to the end user. The best time to write a changelog is when the change happens.
For minor stuff that doesn’t need to be in the changelog, the action checks a label and passes if “skip changelog” is applied. But the default is “hey, you forgot to tell users what they should expect with your change”
- The mandatory formatting takes up prime real estate in the subject line
- You don’t get much data out of it: one byte (rounded up) since it’s just “type” and “is breaking change or not”. Not a great trade considering how much it sticks out
- It subjectively looks bad: “feat”, “chore”, codey exclamation mark (punctuation) for breaking changes, and BREAKING CHANGE in all-caps (it’s supposed to be machine readable so why shout, your programs are supposed to pick up this for you)
- You have to care about this for every final commit that lands in the project
- Just to serve a changelog (which is supposed to just ape the git log?)
I'm also aware of related tool in this space: semantic-release <https://github.com/semantic-release/semantic-release>. I haven't used it in my repositories, but it seems like a more comprehensive verison of git-cliff.
For everyone saying "manually written changelogs are so much better" - well, yeah of course! But they also take up a lot more time and resource to curate. I'd hate to see a huge project like gnome or something do this, but I don't think that's the pitch.
As an alternative for either a badly maintained changelog, or no changelog at all, adopting commit or PR conventions is a great idea.
That said, I am wanting a Github action based release workflow and want it to scale to manual edits of changelogs, so this is insufficient for me. Instead, I've been taking notes on changelog fragments as I hope they can offer the best of both worlds, see https://github.com/epage/epage.github.io/issues/23
But if you insist on using the git history for change log, why not use an LLM? You could feed git history to chatgpt and get a nice user-friendly change log.
https://en.wikipedia.org/wiki/Spoonerism
“The GIF search tool that finds it”, perhaps.
Because of this Windows users can simply run "winget install git-cliff".
Small things like this help with adoption.
I think there should be both a generated changelog and an official changelog when a release is made.
Git log ≠ ChangeLog
Related
Show HN: Sandcastle – a minimal, lightweight build tool and shell automator
SandCastle is a versatile lightweight build tool for various languages and shells. Users define tasks in a _castle.yaml_ file, supporting shells like bash and zsh. Installation offers pre-built binaries or source compilation for Windows, Linux, and MacOS.
Show HN: Qq: like jq, but can transcode between many formats
The GitHub repository hosts `qq`, a tool using `jq` query syntax and `gojq` for configuration format transcoding. It offers interactive query building, multiple format support, and encoding performance focus. Installation options include source or releases. Contributions welcome.
Show HN: Triplit – Open-source syncing database that runs on server and client
The GitHub URL provides details on `@changesets/cli`, a tool for versioning and publishing code in multi-package and single-package repositories. Full documentation and common questions are accessible in their repository.
Show HN: Glasskube – Open Source Kubernetes Package Manager, alternative to Helm
The GitHub repository for Glasskube, a Kubernetes package manager, offers a user-friendly CLI/UI, package management, secure updates, GitOps integration, reactions/comments, and support for private packages. It includes installation guides, architecture, support channels, and contribution guidelines.
Igneous Linearizer: semi-structured source code
The Igneous Linearizer project enhances source code in Obsidian Markdown format, enabling features like links and transclusion. It sacrifices AST correctness for compatibility with text editors and Git, benefiting literate programming. Users must follow specific input file formats for optimal use.