Skip to main content

What's new in 2.5.0? πŸ†•

Β· 6 min read
Orhun ParmaksΔ±z
Author of git-cliff

git-cliff is a command-line tool (written in Rust) that provides a highly customizable way to generate changelogs from git history.

It supports using custom regular expressions to alter changelogs which are mostly based on conventional commits. With a single configuration file, a wide variety of formats can be applied for a changelog, thanks to the Jinja2/Django-inspired template engine.

More information and examples can be found in the GitHub repository.

What's new? ⛰️​

The full changelog can be found here.


πŸ”₯ Generate changelog from context​

Meet our powerful new command-line argument: --from-context.

# create a context
$ git cliff --context -o context.json

# generate changelog from context
$ git cliff --from-context context.json

This new extension point allows transformations on the context and can be especially useful when preprocessor/postprocessor/linkprocessor capabilities are limited.

One example use case is:

  1. Print context
  2. Modify it with an external tool
  3. Pipe it back into git-cliff

If you need additional data in the changelog, you can also use the newly added extra free-form metadata in the context:

{
"id": "5061081d6272b1da2146fab49d803c193db309d9",
"message": "commit message",
"extra": {
"note": "this can be anything"
}
}

🧩 Grouping by arbitrary fields​

git-cliff now supports grouping commits by arbitrary context fields instead of just a limited set. This means that you can use any context field for commit_parsers as field.

For example, to group by GitHub PR labels:

[git]
commit_parsers = [
{ field = "github.pr_labels", pattern = "breaking-change", group = "<!-- 0 --> πŸ—οΈ Breaking changes" },
{ field = "github.pr_labels", pattern = "type/enhancement", group = "<!-- 1 --> πŸš€ Features" },
{ field = "github.pr_labels", pattern = "type/bug", group = "<!-- 2 --> πŸ› Fixes" },
{ field = "github.pr_labels", pattern = "type/update", group = "<!-- 3 --> πŸ§ͺ Dependencies" },
{ field = "github.pr_labels", pattern = "type/refactor", group = "<!-- 4 --> 🏭 Refactor" },
{ field = "github.pr_labels", pattern = "area/documentation", group = "<!-- 5 --> πŸ“ Documentation" },
{ field = "github.pr_labels", pattern = ".*", group = "<!-- 6 --> πŸŒ€ Miscellaneous" },
]

See the commit_parsers documentation for more information.


⬆️ Bump specific versions​

Now you can specify the semver type while using --bump:

$ git cliff --bump [major|minor|patch]

See the bump documentation for more information.


⚑ Gotta go fast​

git-cliff now runs 258x faster for --include-path/--exclude-path arguments thanks to caching the commit retain checks.

Now: 0.080 s
Before: 20.633 s

We also improved handling of include/exclude patterns (e.g., by considering the first commit).

See the implementation for cool flamegraphs and more!


πŸ’― Performance profiling​

git-cliff now supports building with performance profiling instrumentation, which helps identify bottlenecks.

To create a flame graph SVG:

$ cargo run --profile=bench --features=profiler

See the documentation for more information.


βš—οΈ Better integration activation​

Before this change, the only way to activate a remote integration (and fetch remote data) was by incorporating the related variables in a template.

This meant that the changelog context wouldn't contain GitHub-related fields unless you used something like github.contributors in your template.

Now we’ve added support for enabling the remote integration in the following cases:

  • If the [remote] table is configured.
  • If the remote is set via command-line arguments (e.g., --github-repo).

So, the following output will contain GitHub variables even with the default template (since the remote is set):

$ git cliff --context --github-repo orhun/git-cliff

Additionally, we fixed a bug where some of the GitHub-related variables were not recognized in the template.


πŸ”’ count_tags​

A new configuration option has been added to the [git] section!

[git]
count_tags = "v.*-beta.*"
info

count_tags works like an inverted version of ignore_tags, including all the commits but only counting the specific tags.

See the implementation for more details and an example use case.


πŸ† KaiCode: Open Source Festival​

git-cliff won a prize for finishing second place in the KaiCode Open Source Festival!

The orhun/git-cliff project (8.3Kβ˜…), a customizable changelog generator, impressed us with its excellent easy-to-read source code, build pipeline organization, integration testing, and active issue triaging. However, code coverage is rather low, some functions are too long, there is a lack of peer reviews, and a lack of clarity in the repository structure. $1024 was the reward.


🦊 GitLab integration fixes​

  • (gitlab) URL-encode the owner in remote requests for GitLab (#742) - (e3e7c07)
  • (args) Allow GitLab groups with --gitlab-repo (#807) - (6fbfdb5)

🧰 Other​

  • (changelog) Skip ssh and x509 signatures in tag messages (#748) - (ecbabbf)
  • (changelog) Allow using --bumped-version without conventional commits (#806) - (e74080c)
  • (config) Allow using environment variables without config file present (#783) - (2471745)
  • (config) Make example templates more user-friendly - (6f8ea19)
  • (lib) Clean up some code (#709) - (4b0c0eb)

Contributions πŸ‘₯​

  • @oberrich made their first contribution in #809
  • @tisonkun made their first contribution in #599
  • @DerTiedemann made their first contribution in #758
  • @DaniPopes made their first contribution in #709
  • @artrz made their first contribution in #779
  • @braineo made their first contribution in #744
  • @myl7 made their first contribution in #776
  • @pawamoy made their first contribution in #774
  • @tonybutt made their first contribution in #742
  • @PigeonF made their first contribution in #748
  • @janbuchar made their first contribution in #784
  • @weichweich made their first contribution in #807

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!

Support πŸŒŸβ€‹

If you liked git-cliff and/or my other projects on GitHub, consider donating to support my open source endeavors.

Have a fantastic day! ⛰️