website/blog/git-cliff-2.11.0.md
git-cliff is a command-line tool that provides a highly customizable way to generate changelogs from the Git history.
The full changelog can be found here.
:::info[Happy new year!]
This is going to be the last release of 2025!
Wishing you all a fantastic new year ahead filled with Git commits, automated changelogs and cliff jumps! 🎄⛰️
:::
git-cliff now supports Azure Devops for remote integration, enabling changelog generation with metadata from Azure DevOps repositories (commits, pull requests, and contributors). 🥳
Simply configure your cliff.toml for your own repository as follows:
# Azure DevOps integration for fetching commit metadata.
[remote.azure_devops]
owner = "shiftme/gitcliff"
repo = "git-cliff-readme-example"
And then update your [changelog].body with the relevant template variables, e.g. {{ commit.remote.pr_number }}, {{ commit.remote.username }} and so on.
e.g. results in:
## What's Changed in v1.0.0
- Initial commit by @orhun
- docs(project): add README.md by @orhun
- feat(parser): add ability to parse arrays by @orhun
- fix(args): rename help argument due to conflict by @orhun
- docs(example)!: add tested usage example by @orhun
### New Contributors
- @orhun made their first contribution
For more information, see the documentation.
Thanks to @amd989 for the implementation in #1283!
A new configuration variable was added for enforcing that all commits are matched by a commit parser:
[git]
commit_parsers = [
{ message = "^feat", group = "Should be matched" },
]
fail_on_unmatched_commit = true
If fail_on_unmatched_commit is set to true, git-cliff will fail when any commit included in the changelog is not matched by any of the configured commit_parsers.
git-cliff now has new custom filters you can use inside templates:
upper_first: Converts the first character of a string to uppercase.
{{ "hello" | upper_first }} → Hello
find_regex: Finds all occurrences of a regex pattern in a string.
{{ "hello world, hello universe" | find_regex(pat="hello") }} → [hello, hello]
replace_regex: Replaces all occurrences of a regex pattern with a string.
{{ "hello world" | replace_regex(from="o", to="a") }} → hella warld
split_regex: Splits a string by a regex pattern.
{{ "hello world, hello universe" | split_regex(pat=" ") }} → [hello, world,, hello, universe]
We have evaluated and increased the verbosity of some log messages to provide better insights into the internal workings of git-cliff.
To get more detailed logs, provide one or multiple -v flags when running:
$ git cliff -vv
The --include_path's behavior has been revised and several reported issues have been addressed in #1290 thanks to @ognis1205!
--include-path is now automatically set to the value of --workdir if the latter is provided. This ensures that commit parsing works as expected when a different working directory is specified.
Before:
git cliff --workdir my_crate --include-path my_crate
After:
git cliff --workdir my_crate
The git-cliff library crates (git_cliff & git_cliff_core) has been improved with several new features and enhancements!
git_cliff::run now returns the generated git_cliff_core::changelog::Changelog,git_cliff::write_changelog helper writes it to a file or stdout,git_cliff::init_config function handles config creation,git_cliff::check_new_version is now public.Breaking changes:
Changelog::new / Changelog::from_context take Config by valueHere is how you can create a minimal git-cliff application in Rust:
use clap::Parser;
use git_cliff::args::Opt;
use git_cliff_core::error::Result;
fn main() -> Result<()> {
let args = Opt::parse();
let changelog = git_cliff::run(args.clone())?;
git_cliff::write_changelog(&args, changelog, std::io::stdout())?;
Ok(())
}
Any contribution is highly appreciated! See the contribution guidelines for getting started.
Feel free to submit issues and join our Discord / Matrix for discussion!
Follow git-cliff on Twitter & Mastodon to not miss any news!
If you liked git-cliff and/or my other projects on GitHub, consider donating to support my open source endeavors.
Have a fantastic day! ⛰️