mirror of
https://github.com/orhun/git-cliff.git
synced 2024-09-11 15:05:30 +03:00
Compare commits
11 Commits
fc10921509
...
c6a47a2323
Author | SHA1 | Date | |
---|---|---|---|
|
c6a47a2323 | ||
|
227a307d85 | ||
|
0ca3fbd2da | ||
|
2e3b8e79a7 | ||
|
5558cc51b1 | ||
|
854b411e47 | ||
|
95c8138586 | ||
|
cc2b748060 | ||
|
f219ebd68a | ||
|
1853a5ce5c | ||
|
63cffa7f9d |
34
.github/fixtures/test-invert-ignore-tags/cliff.toml
vendored
Normal file
34
.github/fixtures/test-invert-ignore-tags/cliff.toml
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
[changelog]
|
||||||
|
# changelog header
|
||||||
|
header = """
|
||||||
|
# Changelog\n
|
||||||
|
All notable changes to this project will be documented in this file.\n
|
||||||
|
"""
|
||||||
|
# template for the changelog body
|
||||||
|
# https://keats.github.io/tera/docs/#introduction
|
||||||
|
body = """
|
||||||
|
{% if version %}\
|
||||||
|
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
|
||||||
|
{% else %}\
|
||||||
|
## [unreleased]
|
||||||
|
{% endif %}\
|
||||||
|
{% for group, commits in commits | group_by(attribute="group") %}
|
||||||
|
### {{ group | upper_first }}
|
||||||
|
{% for commit in commits %}
|
||||||
|
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
|
||||||
|
{% endfor %}
|
||||||
|
{% endfor %}\n
|
||||||
|
"""
|
||||||
|
# template for the changelog footer
|
||||||
|
footer = """
|
||||||
|
<!-- generated by git-cliff -->
|
||||||
|
"""
|
||||||
|
# remove the leading and trailing whitespace from the templates
|
||||||
|
trim = true
|
||||||
|
|
||||||
|
[git]
|
||||||
|
# regex for skipping tags
|
||||||
|
skip_tags = "v0.1.0-beta.1"
|
||||||
|
# regex for ignoring tags
|
||||||
|
ignore_tags = "v.*-beta.*"
|
||||||
|
count_tags = "v0.2.0"
|
15
.github/fixtures/test-invert-ignore-tags/commit.sh
vendored
Executable file
15
.github/fixtures/test-invert-ignore-tags/commit.sh
vendored
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
GIT_COMMITTER_DATE="2021-01-23 01:23:45" git commit --allow-empty -m "feat: add skip feature"
|
||||||
|
git tag v0.1.0-beta.1
|
||||||
|
|
||||||
|
GIT_COMMITTER_DATE="2021-01-23 01:23:46" git commit --allow-empty -m "feat: add feature 1"
|
||||||
|
GIT_COMMITTER_DATE="2021-01-23 01:23:47" git commit --allow-empty -m "feat: fix feature 1"
|
||||||
|
git tag v0.1.0
|
||||||
|
|
||||||
|
GIT_COMMITTER_DATE="2021-01-23 01:23:48" git commit --allow-empty -m "feat: add feature 2"
|
||||||
|
git tag v0.2.0-beta.1
|
||||||
|
|
||||||
|
GIT_COMMITTER_DATE="2021-01-23 01:23:49" git commit --allow-empty -m "feat: add feature 3"
|
||||||
|
git tag v0.2.0
|
14
.github/fixtures/test-invert-ignore-tags/expected.md
vendored
Normal file
14
.github/fixtures/test-invert-ignore-tags/expected.md
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# Changelog
|
||||||
|
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [0.2.0] - 2021-01-23
|
||||||
|
|
||||||
|
### Feat
|
||||||
|
|
||||||
|
- Add feature 1
|
||||||
|
- Fix feature 1
|
||||||
|
- Add feature 2
|
||||||
|
- Add feature 3
|
||||||
|
|
||||||
|
<!-- generated by git-cliff -->
|
1
.github/workflows/test-fixtures.yml
vendored
1
.github/workflows/test-fixtures.yml
vendored
@ -22,6 +22,7 @@ jobs:
|
|||||||
- fixtures-name: test-gitea-integration
|
- fixtures-name: test-gitea-integration
|
||||||
- fixtures-name: test-bitbucket-integration
|
- fixtures-name: test-bitbucket-integration
|
||||||
- fixtures-name: test-ignore-tags
|
- fixtures-name: test-ignore-tags
|
||||||
|
- fixtures-name: test-invert-ignore-tags
|
||||||
- fixtures-name: test-topo-order
|
- fixtures-name: test-topo-order
|
||||||
command: --latest
|
command: --latest
|
||||||
- fixtures-name: test-date-order
|
- fixtures-name: test-date-order
|
||||||
|
41
CHANGELOG.md
41
CHANGELOG.md
@ -1,5 +1,44 @@
|
|||||||
[![animation](https://raw.githubusercontent.com/orhun/git-cliff/main/website/static/img/git-cliff-anim.gif)](https://git-cliff.org)
|
[![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
|
## [2.3.0](https://github.com/orhun/git-cliff/compare/v2.2.2..v2.3.0) - 2024-06-03
|
||||||
|
|
||||||
### ⛰️ Features
|
### ⛰️ Features
|
||||||
@ -24,7 +63,6 @@
|
|||||||
- *(cd)* Use macos-14 runner - ([22c94ed](https://github.com/orhun/git-cliff/commit/22c94ed8355d71a5fe99d8c1e9c8a3824338debf))
|
- *(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))
|
- *(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))
|
- *(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
|
## [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
|
### ⚙️ 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)* 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))
|
- *(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))
|
- *(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
16
Cargo.lock
generated
@ -759,7 +759,7 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "git-cliff"
|
name = "git-cliff"
|
||||||
version = "2.3.0"
|
version = "2.4.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"clap_complete",
|
"clap_complete",
|
||||||
@ -780,7 +780,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "git-cliff-core"
|
name = "git-cliff-core"
|
||||||
version = "2.3.0"
|
version = "2.4.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"config",
|
"config",
|
||||||
"dirs",
|
"dirs",
|
||||||
@ -828,9 +828,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "git2"
|
name = "git2"
|
||||||
version = "0.18.3"
|
version = "0.19.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70"
|
checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.5.0",
|
"bitflags 2.5.0",
|
||||||
"libc",
|
"libc",
|
||||||
@ -1364,9 +1364,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libgit2-sys"
|
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"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8"
|
checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"libc",
|
"libc",
|
||||||
@ -2227,9 +2227,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.117"
|
version = "1.0.118"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3"
|
checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"ryu",
|
"ryu",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "git-cliff-core"
|
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"
|
description = "Core library of git-cliff"
|
||||||
authors = ["git-cliff contributors <git-cliff@protonmail.com>"]
|
authors = ["git-cliff contributors <git-cliff@protonmail.com>"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
@ -51,7 +51,7 @@ dirs.workspace = true
|
|||||||
lazy_static.workspace = true
|
lazy_static.workspace = true
|
||||||
thiserror = "1.0.61"
|
thiserror = "1.0.61"
|
||||||
serde = { version = "1.0.203", features = ["derive"] }
|
serde = { version = "1.0.203", features = ["derive"] }
|
||||||
serde_json = "1.0.117"
|
serde_json = "1.0.118"
|
||||||
serde_regex = "1.1.0"
|
serde_regex = "1.1.0"
|
||||||
tera = "1.20.0"
|
tera = "1.20.0"
|
||||||
indexmap = { version = "2.2.6", optional = true }
|
indexmap = { version = "2.2.6", optional = true }
|
||||||
@ -76,7 +76,7 @@ url = "2.5.2"
|
|||||||
dyn-clone = "1.0.17"
|
dyn-clone = "1.0.17"
|
||||||
|
|
||||||
[dependencies.git2]
|
[dependencies.git2]
|
||||||
version = "0.18.3"
|
version = "0.19.0"
|
||||||
default-features = false
|
default-features = false
|
||||||
optional = true
|
optional = true
|
||||||
|
|
||||||
|
@ -784,6 +784,7 @@ mod test {
|
|||||||
tag_pattern: None,
|
tag_pattern: None,
|
||||||
skip_tags: Regex::new("v3.*").ok(),
|
skip_tags: Regex::new("v3.*").ok(),
|
||||||
ignore_tags: None,
|
ignore_tags: None,
|
||||||
|
count_tags: None,
|
||||||
topo_order: Some(false),
|
topo_order: Some(false),
|
||||||
sort_commits: Some(String::from("oldest")),
|
sort_commits: Some(String::from("oldest")),
|
||||||
link_parsers: None,
|
link_parsers: None,
|
||||||
|
@ -109,6 +109,9 @@ pub struct GitConfig {
|
|||||||
/// Regex to ignore matched tags.
|
/// Regex to ignore matched tags.
|
||||||
#[serde(with = "serde_regex", default)]
|
#[serde(with = "serde_regex", default)]
|
||||||
pub ignore_tags: Option<Regex>,
|
pub ignore_tags: Option<Regex>,
|
||||||
|
/// Regex to count matched tags.
|
||||||
|
#[serde(with = "serde_regex", default)]
|
||||||
|
pub count_tags: Option<Regex>,
|
||||||
/// Whether to sort tags topologically.
|
/// Whether to sort tags topologically.
|
||||||
pub topo_order: Option<bool>,
|
pub topo_order: Option<bool>,
|
||||||
/// Sorting of the commits inside sections.
|
/// Sorting of the commits inside sections.
|
||||||
|
@ -118,6 +118,7 @@ fn generate_changelog() -> Result<()> {
|
|||||||
tag_pattern: None,
|
tag_pattern: None,
|
||||||
skip_tags: None,
|
skip_tags: None,
|
||||||
ignore_tags: None,
|
ignore_tags: None,
|
||||||
|
count_tags: None,
|
||||||
topo_order: None,
|
topo_order: None,
|
||||||
sort_commits: None,
|
sort_commits: None,
|
||||||
link_parsers: Some(vec![
|
link_parsers: Some(vec![
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "git-cliff"
|
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 ⛰️"
|
description = "A highly customizable changelog generator ⛰️"
|
||||||
authors = ["git-cliff contributors <git-cliff@protonmail.com>"]
|
authors = ["git-cliff contributors <git-cliff@protonmail.com>"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
@ -53,7 +53,7 @@ indicatif = { version = "0.17.8", optional = true }
|
|||||||
env_logger = "0.10.2"
|
env_logger = "0.10.2"
|
||||||
|
|
||||||
[dependencies.git-cliff-core]
|
[dependencies.git-cliff-core]
|
||||||
version = "2.3.0" # managed by release.sh
|
version = "2.4.0" # managed by release.sh
|
||||||
path = "../git-cliff-core"
|
path = "../git-cliff-core"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
@ -88,6 +88,7 @@ fn process_repository<'a>(
|
|||||||
let mut tags = repository.tags(&config.git.tag_pattern, args.topo_order)?;
|
let mut tags = repository.tags(&config.git.tag_pattern, args.topo_order)?;
|
||||||
let skip_regex = config.git.skip_tags.as_ref();
|
let skip_regex = config.git.skip_tags.as_ref();
|
||||||
let ignore_regex = config.git.ignore_tags.as_ref();
|
let ignore_regex = config.git.ignore_tags.as_ref();
|
||||||
|
let count_tags = config.git.count_tags.as_ref();
|
||||||
tags = tags
|
tags = tags
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|(_, tag)| {
|
.filter(|(_, tag)| {
|
||||||
@ -96,6 +97,16 @@ fn process_repository<'a>(
|
|||||||
// Keep skip tags to drop commits in the later stage.
|
// Keep skip tags to drop commits in the later stage.
|
||||||
let skip = skip_regex.map(|r| r.is_match(name)).unwrap_or_default();
|
let skip = skip_regex.map(|r| r.is_match(name)).unwrap_or_default();
|
||||||
|
|
||||||
|
let count = count_tags
|
||||||
|
.map(|r| {
|
||||||
|
let count_tag = r.is_match(name);
|
||||||
|
if count_tag {
|
||||||
|
trace!("Counting release: {}", name)
|
||||||
|
}
|
||||||
|
count_tag
|
||||||
|
})
|
||||||
|
.unwrap_or(true);
|
||||||
|
|
||||||
let ignore = ignore_regex
|
let ignore = ignore_regex
|
||||||
.map(|r| {
|
.map(|r| {
|
||||||
if r.as_str().trim().is_empty() {
|
if r.as_str().trim().is_empty() {
|
||||||
@ -110,7 +121,7 @@ fn process_repository<'a>(
|
|||||||
})
|
})
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
skip || !ignore
|
skip || (count && !ignore)
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "git-cliff",
|
"name": "git-cliff",
|
||||||
"version": "2.3.0",
|
"version": "2.4.0",
|
||||||
"description": "A highly customizable Changelog Generator that follows Conventional Commit specifications ⛰️",
|
"description": "A highly customizable Changelog Generator that follows Conventional Commit specifications ⛰️",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "lib/cjs/index.d.cts",
|
"main": "lib/cjs/index.d.cts",
|
||||||
@ -88,12 +88,12 @@
|
|||||||
"typescript": "^5.3.3"
|
"typescript": "^5.3.3"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"optionalDependencies": {
|
||||||
"git-cliff-darwin-arm64": "2.3.0",
|
"git-cliff-darwin-arm64": "2.4.0",
|
||||||
"git-cliff-darwin-x64": "2.3.0",
|
"git-cliff-darwin-x64": "2.4.0",
|
||||||
"git-cliff-linux-arm64": "2.3.0",
|
"git-cliff-linux-arm64": "2.4.0",
|
||||||
"git-cliff-linux-x64": "2.3.0",
|
"git-cliff-linux-x64": "2.4.0",
|
||||||
"git-cliff-windows-arm64": "2.3.0",
|
"git-cliff-windows-arm64": "2.4.0",
|
||||||
"git-cliff-windows-x64": "2.3.0"
|
"git-cliff-windows-x64": "2.4.0"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"extends": [
|
"extends": [
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
slug: 2.3.0
|
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
|
date: 2024-06-03T00:00:00.000Z
|
||||||
authors: orhun
|
authors: orhun
|
||||||
tags:
|
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!
|
Using `-` for `stdout` is common among CLI tools and `git-cliff` now supports this!
|
||||||
|
|
||||||
```
|
```sh
|
||||||
$ git-cliff -o -
|
$ git-cliff -o -
|
||||||
```
|
```
|
||||||
|
|
||||||
|
304
website/blog/git-cliff-2.4.0.md
Normal file
304
website/blog/git-cliff-2.4.0.md
Normal 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! ⛰️
|
@ -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.
|
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
|
### topo_order
|
||||||
|
|
||||||
If set to `true`, tags are processed in topological order instead of chronological.
|
If set to `true`, tags are processed in topological order instead of chronological.
|
||||||
|
Loading…
Reference in New Issue
Block a user