Skip to main content

What's new in 2.9.0? πŸ†•

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

git-cliff is a command-line tool that provides a highly customizable way to generate changelogs from the Git history.


10k Stars! πŸŒŸβ€‹

Started from the cd69e764f68e5f09cf6e14975e6a876cdccbcfb9, now we're here.

Click here for the star history

star history

git-cliff has reached a whopping 10000 stars on GitHub and I wanted to celebrate this huge milestone with giving away a limited edition T-shirt!

giveaway

You can join the giveaway by clicking here. Nothing else is required!

If you want to buy the T-shirt and support the project, visit our shop at Grindhouse for different sizes and colors!

Thank you all for the support and love you have shown to git-cliff! β›°οΈπŸ§‘


What's new? ⛰️​

The full changelog can be found here.


πŸŒ€ Submodule Support​

git-cliff now supports submodules! You can recurse into submodules and generate changelogs for them as well.

Just set the following option in your configuration file:

[git]
recurse_submodules = true

And then you can use the submodule_commits template variable to access the commits of submodules as follows:

[changelog]
body = """
{% for submodule_path, commits in submodule_commits %}
### {{ submodule_path | upper_first }}
{% for group, commits in commits | group_by(attribute="group") %}
#### {{ group | upper_first }}
{% for commit in commits %}
- {{ commit.message | upper_first }}\
{% endfor %}
{% endfor %}
{% endfor %}\n
"""

Thanks @lehmanju for the implementation in #1082!


⚠️ Conventional commit check​

git-cliff can now check if the commits in the repository follow the conventional commits specification.

To enable this check, set the require_conventional option in your configuration file:

[git]
require_conventional = true

If any unconventional commits are found, an error will be thrown and the changelog generation will fail.


πŸ›°οΈ Remote config​

Have a configuration file elsewhere on the internet? No probs.

$ git cliff --config-url https://github.com/orhun/git-cliff/blob/main/examples/github-keepachangelog.toml?raw=true

The new --config-url option allows you to specify a URL to a configuration file!


↔️ Commit range variable​

The template context now includes a commit_range variable that contains the range of commits that were used to generate the changelog.

Can be used as follows:

{{ commit_range.from }}..{{ commit_range.to }}

Results in:

a140cef0405e0bcbfb5de44ff59e091527d91b38..a9d4050212a18f6b3bd76e2e41fbb9045d268b80
tip

You can use the truncate filter to shorten the commit range:

{{ commit_range.from | truncate(length=7, end="") }}..{{ commit_range.to | truncate(length=7, end="") }}

Results in:

a140cef..a9d4050

🌿 Better branch support​

git-cliff used to only support the default branches of the remotes (e.g., main branch on GitHub).

Now, it can fetch commits from the correct branch automatically based on the commit range that you provide.

For example:

$ git cliff v1.0.0..v1.0.1 --github-repo my-org/my-private-repo

This command used to default to the main branch of the my-org/my-private-repo repository. Now, it will use the v1.1 branch thus using the correct commits for the changelog.

Similarly:

$ git cliff 9f66ac0f76..89de5e8e50 --gitlab-repo my-org/my-private-repo

The changelog will contains commits up to the commit 89de5e8e50.

Thanks to @william-stacken for the implementation in #1086!


πŸ”’ Disable topological sorting​

The topological sorting of commits can now be disabled by setting the topological_sort option to false in your configuration file:

[git]
topo_order_commits = false
  • If false, the commits will be sorted in the order they were committed, without considering their parent-child relationships.
    • This is equivalent to running git log.
  • Otherwise, if true (default), the commits will be sorted topologically, which means that the commits will be ordered in such a way that all parent commits come before their children.
    • This is equivalent to running git log --topo-order.

πŸ“ New blog posts​

Check out the new blog posts from the community members:


πŸ›‘οΈ Remove tj-actions​

There was a security issue reported in the tj-actions organization.

There is also a GitHub Action created for git-cliff: tj-actions/git-cliff.

The action seems to be unaffected by the compromise, but I have removed all the references to it from the documentation and the website for safety.


πŸ› Various Bug Fixes​

  • (bump) Check the next version against tag_pattern regex (#1070) - (c4f0d28)
  • (bump) Accept lowercase values for bump_type config (#1101) - (77632b2)
  • (git) Handle worktrees while retrieving the path of repository (#1054) - (fab02b0)
  • (remote) Fix detection of GitLab merge request sha if commits were squashed (#1043) - (5f3a3d0)
  • (submodules) Fix submodules handling when using custom range (#1136) - (451a694)
  • (template) Correctly serialize JSON for the commit fields (#1145) - (e981e1d)

🧰 Other​

  • (project) Migrate to Rust 2024 edition (#1128) - (4445f06)
  • (config) Initialize config structs with default values (#1090) - (9e4bd07)
  • (quickstart) Clarify git-cliff command (#1051) - (cd26bb2)
  • (security) Extend security policy (#1142) - (4c3c946)

New Contributors ❀️​

  • @ognis1205 made their first contribution in #1145
  • @janderssonse made their first contribution in #1142
  • @jdrst made their first contribution in #1138
  • @lehmanju made their first contribution in #1136
  • @Jean-Beru made their first contribution in #1132
  • @william-stacken made their first contribution in #1086
  • @SebClapie made their first contribution in #1121
  • @okydk made their first contribution in #1051

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! ⛰️