1
1
mirror of https://github.com/orhun/git-cliff.git synced 2024-08-16 18:30:30 +03:00

Compare commits

...

7 Commits

Author SHA1 Message Date
DaniPopes
ebfece536b
Merge b6d2a219c6 into 227a307d85 2024-06-26 03:33:35 -07:00
Orhun Parmaksız
227a307d85
docs(website): add header to 2.4.0 blog post 2024-06-26 13:32:45 +03:00
Orhun Parmaksız
0ca3fbd2da
chore(release): prepare for v2.4.0 2024-06-26 12:55:35 +03:00
dependabot[bot]
2e3b8e79a7
chore(deps): bump git2 from 0.18.3 to 0.19.0 (#700)
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.18.3 to 0.19.0.
- [Changelog](https://github.com/rust-lang/git2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/git2-rs/compare/git2-0.18.3...git2-0.19.0)

---
updated-dependencies:
- dependency-name: git2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 12:53:10 +03:00
Orhun Parmaksız
5558cc51b1
docs(website): add highlights for 2.4.0 (#729) 2024-06-26 12:49:31 +03:00
Mateusz Kurowski
854b411e47
docs(website): add more context about ignore_tags matching commits (#710)
Signed-off-by: Bukowa <gitbukowa@gmail.com>
2024-06-26 12:47:14 +03:00
dependabot[bot]
95c8138586
chore(deps): bump serde_json from 1.0.117 to 1.0.118 (#728)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.117 to 1.0.118.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.117...v1.0.118)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 12:46:37 +03:00
8 changed files with 368 additions and 24 deletions

View File

@ -1,5 +1,44 @@
[![animation](https://raw.githubusercontent.com/orhun/git-cliff/main/website/static/img/git-cliff-anim.gif)](https://git-cliff.org)
## [2.4.0](https://github.com/orhun/git-cliff/compare/v2.3.0..v2.4.0) - 2024-06-26
### ⛰️ Features
- *(args)* Add `--ignore-tags` argument ([#696](https://github.com/orhun/git-cliff/issues/696)) - ([94891c2](https://github.com/orhun/git-cliff/commit/94891c2c27b1f46cb840fbea1e167c161609cbcd))
- *(bump)* Support bumping based on configurable custom pattern ([#725](https://github.com/orhun/git-cliff/issues/725)) - ([8e03356](https://github.com/orhun/git-cliff/commit/8e03356706c8aa89eac80953bc2a01ed3f93bb52))
- *(bump)* Support setting the `initial_tag` ([#701](https://github.com/orhun/git-cliff/issues/701)) - ([7341500](https://github.com/orhun/git-cliff/commit/734150020e1e2763eaac7aa10acf80f82169b60e))
- *(changelog)* Add tag message to release context ([#713](https://github.com/orhun/git-cliff/issues/713)) - ([3eb828e](https://github.com/orhun/git-cliff/commit/3eb828e69ad3a5b94833f67dfe287e7d8b31a274))
- *(changelog)* Make `changelog.header` a template ([#698](https://github.com/orhun/git-cliff/issues/698)) - ([9fc12bb](https://github.com/orhun/git-cliff/commit/9fc12bb90cac732d8621446e4d4de775e7f0ba9a))
- *(changelog)* Support parsing commits by footer ([#569](https://github.com/orhun/git-cliff/issues/569)) - ([50c240c](https://github.com/orhun/git-cliff/commit/50c240c25b632c670b23e0bac943ff94eeb3dfb7))
- *(changelog)* Make remote data available in context ([#703](https://github.com/orhun/git-cliff/issues/703)) - ([d14774a](https://github.com/orhun/git-cliff/commit/d14774ae4afb086819d9669dfc050fac1c237de8))
- *(codeberg)* Add Gitea support ([#680](https://github.com/orhun/git-cliff/issues/680)) - ([403d3dc](https://github.com/orhun/git-cliff/commit/403d3dcd32246fba5c1e1c50bc1f95410e3ee5e4))
- *(context)* Add repository path to template context ([#721](https://github.com/orhun/git-cliff/issues/721)) - ([e7807e1](https://github.com/orhun/git-cliff/commit/e7807e13c4b38aaa4a735ff05b69fdd6b57a7a85))
### 🐛 Bug Fixes
- *(fixture)* Support running fixtures on mingw64 ([#708](https://github.com/orhun/git-cliff/issues/708)) - ([dabe716](https://github.com/orhun/git-cliff/commit/dabe716c201fedf3021d89c5a8564794bda07f2a))
- *(website)* Update dependencies to fix search issue - ([8a9f9f4](https://github.com/orhun/git-cliff/commit/8a9f9f48da42ec95f47a169370c6c5cdf2a0b327))
### 🚜 Refactor
- *(bump)* Add documentation and simplify implementation - ([bea4916](https://github.com/orhun/git-cliff/commit/bea49161e9bd9bc999889aca22ed4c0f18f53ca1))
### 📚 Documentation
- *(website)* Add highlights for 2.4.0 ([#729](https://github.com/orhun/git-cliff/issues/729)) - ([5558cc5](https://github.com/orhun/git-cliff/commit/5558cc51b17cbc9c09bf9a2938ed227f1d1bda11))
- *(website)* Add more context about `ignore_tags` matching commits ([#710](https://github.com/orhun/git-cliff/issues/710)) - ([854b411](https://github.com/orhun/git-cliff/commit/854b411e474b21c870afb0636512b471bf737c4c))
- *(website)* Fix link to github-keepachangelog template ([#694](https://github.com/orhun/git-cliff/issues/694)) - ([eac2195](https://github.com/orhun/git-cliff/commit/eac2195963e1688cd865969a01cc944d6a4af7b4))
- *(website)* Add information about `--bump` with `tag prefixes` ([#695](https://github.com/orhun/git-cliff/issues/695)) - ([4cd18c2](https://github.com/orhun/git-cliff/commit/4cd18c2bcdb2ce21234776364598d42261df004d))
### 🎨 Styling
- *(lint)* Fix formatting - ([5b58a37](https://github.com/orhun/git-cliff/commit/5b58a3771d056a95b9ec93ff4a7d0d5bf49b8473))
- *(lint)* Fix formatting ([#702](https://github.com/orhun/git-cliff/issues/702)) - ([b7e323f](https://github.com/orhun/git-cliff/commit/b7e323f8ec948f7ab9d2f821e0da77e4d936475d))
### 🧪 Testing
- *(template)* Add tests ([#674](https://github.com/orhun/git-cliff/issues/674)) - ([a51422d](https://github.com/orhun/git-cliff/commit/a51422dda9431a3f24b4b061ab055ac97fa018de))
## [2.3.0](https://github.com/orhun/git-cliff/compare/v2.2.2..v2.3.0) - 2024-06-03
### ⛰️ Features
@ -24,7 +63,6 @@
- *(cd)* Use macos-14 runner - ([22c94ed](https://github.com/orhun/git-cliff/commit/22c94ed8355d71a5fe99d8c1e9c8a3824338debf))
- *(example)* Allow using github template without github variables ([#672](https://github.com/orhun/git-cliff/issues/672)) - ([6a9feba](https://github.com/orhun/git-cliff/commit/6a9feba98f36de1980bab313f6b0a861f5009d71))
- *(links)* Ignore patreon links - ([bfe2774](https://github.com/orhun/git-cliff/commit/bfe27744701296185d2f1d37dba7cfb48bd70519))
- *(npm)* Update yarn.lock - ([1c2b4ac](https://github.com/orhun/git-cliff/commit/1c2b4ac85b49f62ae6f19660e7e47b3bc24a5cae))
## [2.2.2](https://github.com/orhun/git-cliff/compare/v2.2.1..v2.2.2) - 2024-05-11
@ -46,7 +84,6 @@
### ⚙️ Miscellaneous Tasks
- *(npm)* Add minimum supported Node versions ([#621](https://github.com/orhun/git-cliff/issues/621)) - ([95bdf2d](https://github.com/orhun/git-cliff/commit/95bdf2db3724715f76a7b649367541ace5ca9d1f))
- *(npm)* Update yarn.lock - ([adc5c5b](https://github.com/orhun/git-cliff/commit/adc5c5ba876281cdeab0d7e7150a32d959f90886))
- *(pypi)* Disable PyPi builds for x86_64-pc-windows-gnu - ([f675b0b](https://github.com/orhun/git-cliff/commit/f675b0b5bdbe57437e39dbe4c0b78e7c4f373936))
- *(tests)* Don't check last commit ([#619](https://github.com/orhun/git-cliff/issues/619)) - ([68b9839](https://github.com/orhun/git-cliff/commit/68b98393e72d4a38a2e9166477784a9e1a55c9cf))

16
Cargo.lock generated
View File

@ -759,7 +759,7 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
[[package]]
name = "git-cliff"
version = "2.3.0"
version = "2.4.0"
dependencies = [
"clap",
"clap_complete",
@ -780,7 +780,7 @@ dependencies = [
[[package]]
name = "git-cliff-core"
version = "2.3.0"
version = "2.4.0"
dependencies = [
"config",
"dirs",
@ -828,9 +828,9 @@ dependencies = [
[[package]]
name = "git2"
version = "0.18.3"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70"
checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724"
dependencies = [
"bitflags 2.5.0",
"libc",
@ -1364,9 +1364,9 @@ dependencies = [
[[package]]
name = "libgit2-sys"
version = "0.16.2+1.7.2"
version = "0.17.0+1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8"
checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224"
dependencies = [
"cc",
"libc",
@ -2227,9 +2227,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.117"
version = "1.0.118"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3"
checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4"
dependencies = [
"itoa",
"ryu",

View File

@ -1,6 +1,6 @@
[package]
name = "git-cliff-core"
version = "2.3.0" # managed by release.sh
version = "2.4.0" # managed by release.sh
description = "Core library of git-cliff"
authors = ["git-cliff contributors <git-cliff@protonmail.com>"]
license = "MIT OR Apache-2.0"
@ -51,7 +51,7 @@ dirs.workspace = true
lazy_static.workspace = true
thiserror = "1.0.61"
serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.117"
serde_json = "1.0.118"
serde_regex = "1.1.0"
tera = "1.20.0"
indexmap = { version = "2.2.6", optional = true }
@ -76,7 +76,7 @@ url = "2.5.2"
dyn-clone = "1.0.17"
[dependencies.git2]
version = "0.18.3"
version = "0.19.0"
default-features = false
optional = true

View File

@ -1,6 +1,6 @@
[package]
name = "git-cliff"
version = "2.3.0" # managed by release.sh
version = "2.4.0" # managed by release.sh
description = "A highly customizable changelog generator ⛰️"
authors = ["git-cliff contributors <git-cliff@protonmail.com>"]
license = "MIT OR Apache-2.0"
@ -53,7 +53,7 @@ indicatif = { version = "0.17.8", optional = true }
env_logger = "0.10.2"
[dependencies.git-cliff-core]
version = "2.3.0" # managed by release.sh
version = "2.4.0" # managed by release.sh
path = "../git-cliff-core"
[dev-dependencies]

View File

@ -1,6 +1,6 @@
{
"name": "git-cliff",
"version": "2.3.0",
"version": "2.4.0",
"description": "A highly customizable Changelog Generator that follows Conventional Commit specifications ⛰️",
"type": "module",
"main": "lib/cjs/index.d.cts",
@ -88,12 +88,12 @@
"typescript": "^5.3.3"
},
"optionalDependencies": {
"git-cliff-darwin-arm64": "2.3.0",
"git-cliff-darwin-x64": "2.3.0",
"git-cliff-linux-arm64": "2.3.0",
"git-cliff-linux-x64": "2.3.0",
"git-cliff-windows-arm64": "2.3.0",
"git-cliff-windows-x64": "2.3.0"
"git-cliff-darwin-arm64": "2.4.0",
"git-cliff-darwin-x64": "2.4.0",
"git-cliff-linux-arm64": "2.4.0",
"git-cliff-linux-x64": "2.4.0",
"git-cliff-windows-arm64": "2.4.0",
"git-cliff-windows-x64": "2.4.0"
},
"eslintConfig": {
"extends": [

View File

@ -1,6 +1,6 @@
---
slug: 2.3.0
title: "What's new in 2.3.0? \U0001F195"
title: What's new in 2.3.0?
date: 2024-06-03T00:00:00.000Z
authors: orhun
tags:
@ -83,7 +83,7 @@ Big thanks to [dark0dave](https://github.com/dark0dave) for the [contribution](h
Using `-` for `stdout` is common among CLI tools and `git-cliff` now supports this!
```
```sh
$ git-cliff -o -
```

View File

@ -0,0 +1,304 @@
---
slug: 2.4.0
title: "What's new in 2.4.0? \U0001F195"
date: 2024-06-26T00:00:00.000Z
authors: orhun
tags:
- release
---
<center>
<a href="https://github.com/orhun/git-cliff">
<img src="/img/git-cliff-anim.gif" />
</a>
</center>
> [**git-cliff**](https://github.com/orhun/git-cliff) is a command-line tool (written in [Rust](https://www.rust-lang.org/)) that provides a highly customizable way to generate changelogs from git history.
>
> It supports using [custom regular expressions](/docs/configuration/git#commit_parsers) to alter changelogs which are mostly based on [conventional commits](/docs/configuration/git#conventional_commits). With a single [configuration file](/docs/configuration), a wide variety of formats can be applied for a changelog, thanks to the Jinja2/Django-inspired [template engine](/docs/category/templating).
>
> More information and examples can be found in the [GitHub repository](https://github.com/orhun/git-cliff).
## What's new? ⛰️
The full changelog can be found [here](https://github.com/orhun/git-cliff/blob/main/CHANGELOG.md).
---
### 🍵 Gitea Integration
`git-cliff` now supports integrating with repositories hosted on Gitea (e.g. [Codeberg](https://codeberg.org/) or your own instance!)
This means that you can now use the following variables in your changelog:
- Usernames (`${{ commit.gitea.username }}` or `${{ contributor.username }}`)
- Contributors list (`${{ gitea.contributors }}`)
- Pull requests (`${{ commit.gitea.pr_number }}` or `${{ contributor.pr_number }}`)
This means you can generate changelog entries like the following:
```md
## What's Changed
- feat(commit): add merge_commit flag to the context by @orhun in #389
- test(fixture): add test fixture for bumping version by @orhun in #360
## New Contributors
- @someone made their first contribution in #360
- @cliffjumper made their first contribution in #389
<!-- generated by git-cliff -->
```
To set up `git-cliff` for your project, simply:
1. Check out the [quickstart guide](https://git-cliff.org/docs/) for installation / initialization.
1. Set up the [Git remote](https://git-cliff.org/docs/configuration/remote/) for your GitLab project.
1. Update the changelog configuration to use the [template variables](https://git-cliff.org/docs/integration/gitea/).
:::tip
See the [Gitea integration](https://git-cliff.org/docs/integration/gitea) for detailed documentation and usage examples. It works very similar to the [GitHub integration](https://git-cliff.org/docs/integration/github).
:::
---
### 📤 Bump based on pattern
The `--bump` argument works as follows:
> - "fix:" -> increments `PATCH`
> - "feat:" -> increments `MINOR`
> - "scope!" (breaking changes) -> increments `MAJOR`
But what happens let's say you want to bump the major if the commit starts with "abc" instead?
Good news, `git-cliff` now supports bumping based on configurable custom patterns! Simply configure the following values in your configuration:
```toml
[bump]
custom_major_increment_regex = "abc"
custom_minor_increment_regex = "minor|more"
```
So with this commit history:
```sh
(HEAD -> main) abc: 1
(tag: 0.1.0) initial commit
```
The major will be bumped due to "abc" (`0.1.0` -> `1.0.0`)
```sh
$ git-cliff --bumped-version
1.0.0
```
---
### ⬆️ Set initial tag for bump
When using `--bump`, if there are no initial tags are found then the default used to be hardcoded as `0.1.0`.
Now you can configure this value in the configuration file as follows:
```toml
[bump]
initial_tag = "1.0.0"
```
You can also override this value from the command line as follows:
```sh
$ git-cliff --bump --tag=1.0.0
```
---
### ⚙️ `--ignore-tags` argument
The value of `[git.ignore_tags]` can now be overridden by the newly added `--ignore-tags` argument:
```sh
$ git-cliff --ignore-tags "rc|v2.1.0|v2.1.1"
```
is the equivalent of:
```toml
[git]
# regex for ignoring tags
ignore_tags = "rc|v2.1.0|v2.1.1"
```
---
### 📝 Header template
`[changelog.header]` is now a template similar to `body` and `footer`. It used to be a raw string value that is added to the top of the changelog but now you can use the template variables and functions in it!
For example:
```toml
[changelog]
# template for the changelog footer
header = """
# Changelog
{% for release in releases %}\
{% if release.version %}\
{% if release.previous.version %}\
<!--{{ release.previous.version }}..{{ release.version }}-->
{% endif %}\
{% else %}\
<!--{{ release.previous.version }}..HEAD-->
{% endif %}\
{% endfor %}\
"""
```
Will result in:
```md
# Changelog
<!--v3.0.0..HEAD-->
<!--v0.2.0..v3.0.0-->
<!--v0.1.0..v0.2.0-->
```
<sup> There is a [pending issue](https://github.com/orhun/git-cliff/issues/712) that needs fixing for `--prepend` to work with header template. </sup>
---
### 🧮 Parse commits by footer
You can now parse the commits by their footer value!
Let's say you want to skip this commit:
```sh
git commit -m "test: add more tests" -m "changelog: ignore"
```
This is now possible:
```toml
[git]
# regex for parsing and grouping commits
commit_parsers = [
{ footer = "^changelog: ?ignore", skip = true },
]
```
---
### 📩 Support tag messages
You can now include the tag messages (of release tags) in your changelog!
This can be useful for having "headlines" for a release like so:
```md
## [1.0.1] - 2021-07-18
This is the release-tag message
```
The message is available in the context of the template as the `{{ message }}` variable:
```
{% if message %}
{{ message }}
{% endif %}\
```
You can also override the tag message for the unreleased changes via `--with-tag-message` argument as follows:
```sh
$ git cliff --bump --unreleased --with-tag-message "This is the release-tag message"
```
The recommended way of setting tag messages is to use annotated tags in your project:
```sh
$ git tag v1.0.0 -m "This is the release-tag message"
```
---
### 📂 Repository path in context
You can now use `{{ repository }}` variable in the template to get the repository path:
```
## Release [{{ version }}] - {{ timestamp | date(format="%Y-%m-%d") }} - {{ repository }}
```
This is especially useful when you use `git-cliff` with multiple repositories. (e.g. `git-cliff -r repo1 -r repo2`)
---
### 📡 Remote data in context
We updated the changelog processing order to make remote data (e.g. GitHub commits, pull requests, etc.) available in the context.
For example:
```sh
$ git cliff --github-repo orhun/git-cliff -c examples/github.toml --no-exec -u -x
```
This command will now contain the GitHub data such as:
```json
"github": {
"contributors": [
{
"username": "bukowa",
"pr_title": "style(lint): fix formatting",
"pr_number": 702,
"pr_labels": [],
"is_first_time": true
},
],
}
```
---
### 🧰 Other
- _(website)_ Add information about `--bump` with `tag prefixes` ([#695](https://github.com/orhun/git-cliff/issues/695)) - ([4cd18c2](https://github.com/orhun/git-cliff/commit/4cd18c2bcdb2ce21234776364598d42261df004d))
- _(fixture)_ Support running fixtures on mingw64 ([#708](https://github.com/orhun/git-cliff/issues/708)) - ([dabe716](https://github.com/orhun/git-cliff/commit/dabe716c201fedf3021d89c5a8564794bda07f2a))
---
## Contributions 👥
- @MeitarR made their first contribution in [#713](https://github.com/orhun/git-cliff/pull/713)
- @bukowa made their first contribution in [#696](https://github.com/orhun/git-cliff/pull/696)
- @Cyclonit made their first contribution in [#698](https://github.com/orhun/git-cliff/pull/698)
- @jan-ferdinand made their first contribution in [#569](https://github.com/orhun/git-cliff/pull/569)
- @Theta-Dev made their first contribution in [#680](https://github.com/orhun/git-cliff/pull/680)
- @tcarmet made their first contribution in [#694](https://github.com/orhun/git-cliff/pull/694)
Any contribution is highly appreciated! See the [contribution guidelines](https://github.com/orhun/git-cliff/blob/main/CONTRIBUTING.md) for getting started.
Feel free to [submit issues](https://github.com/orhun/git-cliff/issues/new/choose) and join our [Discord](https://discord.gg/W3mAwMDWH4) / [Matrix](https://matrix.to/#/#git-cliff:matrix.org) for discussion!
Follow `git-cliff` on [Twitter](https://twitter.com/git_cliff) & [Mastodon](https://fosstodon.org/@git_cliff) to not miss any news!
## Support 🌟
If you liked `git-cliff` and/or my other projects [on GitHub](https://github.com/orhun), consider [donating](https://donate.orhun.dev) to support my open source endeavors.
- 💖 GitHub Sponsors: [@orhun](https://github.com/sponsors/orhun)
- ☕ Buy Me A Coffee: [https://www.buymeacoffee.com/orhun](https://www.buymeacoffee.com/orhun)
Have a fantastic day! ⛰️

View File

@ -201,6 +201,9 @@ This value can be also overridden with using the `--ignore-tags` argument.
While `skip_tags` drop commits from the changelog, `ignore_tags` include ignored commits into the next tag.
* Note that if a commit has multiple tags, any matched tag will result in all associated tags being ignored, including those not explicitly matched by the regex. This is because git-cliff processes tags at the commit level rather than individually.
For more details, you can view the discussion [here](https://github.com/orhun/git-cliff/discussions/707)
### topo_order
If set to `true`, tags are processed in topological order instead of chronological.