1
1
mirror of https://github.com/orhun/git-cliff.git synced 2024-11-29 13:23:40 +03:00
Commit Graph

428 Commits

Author SHA1 Message Date
Orhun Parmaksız
1cdbbf604c
fix(commit): trim the trailing newline for git2 commits (#872) 2024-09-21 18:39:30 +03:00
Nejc Galof
4956fc7797
refactor(clippy): apply explicit_iter_loop lint (#864) 2024-09-18 14:49:01 +03:00
Nejc Galof
81d4e5a36c
refactor(clippy): apply manual_is_variant_and lint (#866) 2024-09-18 14:47:00 +03:00
dependabot[bot]
5655b80a96
chore(deps): bump pretty_assertions from 1.4.0 to 1.4.1 (#862)
Bumps [pretty_assertions](https://github.com/rust-pretty-assertions/rust-pretty-assertions) from 1.4.0 to 1.4.1.
- [Release notes](https://github.com/rust-pretty-assertions/rust-pretty-assertions/releases)
- [Changelog](https://github.com/rust-pretty-assertions/rust-pretty-assertions/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-pretty-assertions/rust-pretty-assertions/compare/v1.4.0...v1.4.1)

---
updated-dependencies:
- dependency-name: pretty_assertions
  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-09-17 11:26:51 +03:00
Nejc Galof
f3b067b3f3
refactor(clippy): apply case_sensitive_file_extension_comparisons lint (#858) 2024-09-16 01:08:27 +03:00
Orhun Parmaksız
82cc09ff75
refactor(clippy): apply clippy suggestions 2024-09-15 22:48:44 +02:00
Nejc Galof
05b6dde4cd
refactor(clippy): apply option_as_ref_cloned lint (#860) 2024-09-15 23:12:12 +03:00
Orhun Parmaksız
e577113bd6
refactor(template)!: add name parameter to the constructor 2024-09-15 22:09:54 +02:00
Orhun Parmaksız
1d8a2fe849
fix(core): avoid the unnecessary loop when no remote feature is activated 2024-09-15 19:31:00 +02:00
Marco Ieni
87e2c1d0dd
feat(core): add remote to commit and deprecate fields (#822)
* feat(core): add `remote` field to commit

* refactor

* fmt

* deprecate old fields

* serialize remote field

* fix

* fix typo

* allow deprecated

* move warn

* move filename

* docs

* docs

* fix

* fmt

* chore(fixtures): use remote instead of platform name for template variables

* remove useless method

* update docs

* use contains_variable

* fix no-default-features

* chore(remote): update template varibles for platforms

* set commit.remote

* chore(release): update unit tests for new remote field

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-09-15 20:28:56 +03:00
Nejc Galof
fe37d148fb
refactor(clippy): apply semicolon_if_nothing_returned clippy lint (#851) 2024-09-15 18:56:50 +03:00
Nejc Galof
9ef62e8a80
refactor(clippy): apply unnested_or_patterns clippy lint (#852) 2024-09-15 18:54:11 +03:00
Binbin
2a581a82bb
feat(changelog): support generating changelog for different branches (#808)
* feat: support generating change log for different branches

* check if the head commit is also a tag commit

* simplify implementation without requiring a branch

* remove unused import

* update test-topo-order fixture

* add comment for should_include_tag

* fix typo

* rename variable

* generate fixture considering timezone difference

* make --use-branch-tags optional for backward compatibility

* add missing field

* refactor: polish implementation

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-09-09 21:16:53 +03:00
Orhun Parmaksız
81854d2166
chore(lib): fix typos in code comments 2024-09-01 10:28:33 +03:00
Albrecht
ff7240633f
fix(changelog): don't change the context when provided via --from-context (#820)
closes orhun/git-cliff/issues/819
2024-08-26 21:07:19 +03:00
Orhun Parmaksız
741528994d
chore(release): prepare for v2.5.0 2024-08-24 10:59:58 +03:00
Albrecht
6fbfdb5963
feat(args): allow GitLab groups with --gitlab-repo (#807)
* feat: allow gitlab groups

* refactor(arg): improve remote value parser

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-08-24 10:44:56 +03:00
Orhun Parmaksız
d727e2662c
chore(deps): bump dependencies (#811)
* chore(deps): bump dependencies

* chore(deps): bump MSRV
2024-08-23 21:08:54 +03:00
Orhun Parmaksız
9a6430bc51
fix(template): include for-loop arguments in template variables (#812) 2024-08-23 21:04:54 +03:00
Jan Buchar
3b6156ddd6
feat(cli): generate changelog from JSON context (#784)
* feat(cli): generate changelog from JSON context

* Add 'extra' field to releases and commits

* Add fixture test

* Serialize extra field for commits

* Format

* Adjust test expectations

* Add missing fields in tests

* Add usage page

* refactor(arg): update from-context argument details

* refactor(from-context): polish implementation

* docs(from-context): extend documentation

* fix(from-context): revert stdin handling

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-08-23 15:39:27 +03:00
Orhun Parmaksız
e74080cec4
fix(changelog): allow using --bumped-version without conventional commits (#806) 2024-08-22 09:11:39 +03:00
tison
b8045e97ed
feat(changelog): support count_tags option (#599)
* feat: support count_tags option

Signed-off-by: tison <wander4096@gmail.com>

* add fixures tags

Signed-off-by: tison <wander4096@gmail.com>

* fixup

Signed-off-by: tison <wander4096@gmail.com>

* add count_tags to args

Signed-off-by: tison <wander4096@gmail.com>

* add docs

Signed-off-by: tison <wander4096@gmail.com>

* run cargo fmt

Signed-off-by: tison <wander4096@gmail.com>

* fixup default to true

Signed-off-by: tison <wander4096@gmail.com>

* docs(website): update documentation about count_tags

---------

Signed-off-by: tison <wander4096@gmail.com>
Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-08-13 12:22:54 +03:00
DerTiedemann
ccf2ab769a
feat(parser): allow whole commit context to be used in commit parsers (#758)
* fix: reorder execution to have context poplulated before parsing/pruning

* feat: allow field to read from context object

* fix: add tests

* fix: add legacy fix for body field

* test: add fixture

* docs: update documentation

* refactor: clean up implementation

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-08-08 22:30:36 +03:00
Amin Yahyaabadi
8430c5c539
perf(changelog): cache commit retain checks (258 times faster generation) (#772)
* perf: cache commit retain checks + 87 times faster generation

This caches the commit retain checks whenever include/exclude paths are specified.

This speeds up changelog generation by `87` times in a big repository I have:
```
Now: 0.237 s
Before:  20.633 s
```

* perf: use separate retain_commit cache for each repository

* fix: use cacache for parallel git-local cache - 258 times faster

Sled fails to open the cache if multiple git-cliff processes run on the same repository. This fixes the issue by using cacache which stores the cache locally under .git/git-cliff

* fix: cache changed files of a commit directly

This slows down the retain_commit check by ~2 times, but allows reusing the cache in case the include/exclude patterns change.
This is beneficial for running in monorepos where git-cliff runs multiple times to generate changelog for different subsets of the repo

* fix: consider include/exclude patterns together

* fix: handle first commit for changed_files

* fix: normalize glob patterns to ignore ./

* docs: add docs for retain_commit_check and cache algorithms

* fix: add ** if a pattern represents a directory

* test: add tests for should retain commit checks

* fix: correctly get the files list for the first commit

* test: add test email/name for git commits

* fix: use / for path joining in entries to match the git behaviour

* fix: revert change of include/exclude patterns to slices

The slices are normalized, so an owned pattern is needed to avoid type mismatch between new normalized/unchanged patterns

* refactor: polish implementation

* refactor: apply clippy suggestion

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-08-06 23:04:17 +03:00
Orhun Parmaksız
2471745e11
fix(config): allow using environment variables without config file present (#783) 2024-08-06 15:58:35 +03:00
Orhun Parmaksız
4b33e7e986
feat(remote): activate integration if remote is set manually (#782) 2024-08-04 22:35:32 +03:00
DaniPopes
4b0c0eb09a
refactor(lib): clean up some code (#709)
* refactor: clean up some code

* Update git-cliff/src/lib.rs

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>

* review

* fmt

* fix: read before opening the file to prepend

* style: update formatting

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-08-04 00:05:26 +03:00
Binbin
9dbf47bac5
feat(bump): support bumping to a specific semver type (#744)
* feat: support bump a specific version type

* let --bump accept optional enum

* doc: update document for --bump

* test: add bump version fixtures tests

* refactor: polish implementation

* refactor: fix typo

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-07-31 08:48:03 +03:00
Orhun Parmaksız
c791418c7e
refactor(gitlab): clean up url encoding for GitLab 2024-07-28 09:12:43 +03:00
Anthony Butt
e3e7c07940
fix(gitlab): URL-encode the owner in remote requests for GitLab (#742)
Gitlab requires that the project path be fully encoded. See the docs for
details. https://docs.gitlab.com/ee/api/rest/#namespaced-path-encoding
Pulls in the urlencoding crate here. Might not be needed when you have
the choice to just update the documentation. I don't think the end user
should be required to url encode their own strings. It might be nicer to
just add the subgroup paradigm to the gitlab config in general for the
future. This will fix the problem for now.
2024-07-28 09:12:32 +03:00
Jonas Fierlings
ecbabbfb39
feat(changelog): skip ssh and x509 signatures in tag messages (#748)
Git supports SSH and x509 signatures in addition to GPG signatures.
See <https://git-scm.com/docs/gitformat-signature#_description>.

The regex is not 100% accurate (e.g. this would allow `SSH MESSAGE`,
which is not part of the gitformat-signature description), but I
prioritized readability over correctness in this case (since the code is
for replacing text, not verifying the signature).
2024-07-27 22:11:20 +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
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
Orhun Parmaksız
e7807e13c4
feat(context): add repository path to template context (#721) 2024-06-25 23:41:37 +03:00
Meitar Reihan
3eb828e69a
feat(changelog): add tag message to release context (#713)
* feat: add tag message to release context

- add to the release context the tag's message if it exists
- add message to the default config

* feat(args): add `--with-tag-message` argument

to allow setting the message of the last release in the context

* docs: update args

* docs: add adding-tag-messages

* refactor: polish implementation

* tests(test-tag-message): fix the template

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-06-22 13:29:49 +03:00
Meitar Reihan
8e03356706
feat(bump): support bumping based on configurable custom pattern (#725)
* chore(deps): bump next_version from 0.2.17 to 0.2.18

Bumps [next_version](https://github.com/MarcoIeni/release-plz) from 0.2.17 to 0.2.18.
- [Release notes](https://github.com/MarcoIeni/release-plz/releases)
- [Changelog](https://github.com/MarcoIeni/release-plz/blob/main/CHANGELOG.md)
- [Commits](https://github.com/MarcoIeni/release-plz/compare/next_version-v0.2.17...next_version-v0.2.18)

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

Signed-off-by: dependabot[bot] <support@github.com>

* feat: Support bumping version based on configurable custom pattern

closes #717

* refactor: clean up implementation

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-06-21 23:38:52 +03:00
dependabot[bot]
7f594e0425
chore(deps): bump url from 2.5.1 to 2.5.2 (#719)
Bumps [url](https://github.com/servo/rust-url) from 2.5.1 to 2.5.2.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v2.5.1...v2.5.2)

---
updated-dependencies:
- dependency-name: url
  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-19 11:53:37 +03:00
dependabot[bot]
7ff4196287
chore(deps): bump reqwest from 0.12.4 to 0.12.5 (#715)
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.12.4 to 0.12.5.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.12.4...v0.12.5)

---
updated-dependencies:
- dependency-name: reqwest
  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-18 12:14:58 +03:00
Cyclonit
9fc12bb90c
feat(changelog): make changelog.header a template (#698)
* feat(changelog): make changelog.header a template (#697)

* refactor: clean up implementation

* docs: update the description of header field

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-06-17 20:43:00 +03:00
Jan Ferdinand Sauer
50c240c25b
feat(changelog): support parsing commits by footer (#569)
* feat: Enable footer-based commit parsing

Enable defining parsers for a commit's footer, similar to the already-
present commit parsers for a commit's message or body.

For example:

```toml
commit_parsers = [
  { footer = "changelog: ignore", skip = true },
]
```

Due to an inconsistency between the conventional commits specification
and its reference parser, footers are currently interpreted as
`key:value` instead of the (correct) `key: value`. See
https://github.com/conventional-commits/parser/issues/47 for details.
As a future-proof workaround, you can use `key: ?value` in the regex.

* chore: fix typo

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-06-16 19:32:39 +03:00
Orhun Parmaksız
bea49161e9
refactor(bump): add documentation and simplify implementation 2024-06-15 21:22:31 +03:00
Buk Bukowski
734150020e
feat(bump): support setting the initial_tag (#701)
* feat: add `initial_tag` to `bump` - allows changing from default `0.1.0` when using `bump` and no tags are found

Signed-off-by: Bukowa <gitbukowa@gmail.com>

* chore(tests): add `test-bump-initial-tag-default`

Signed-off-by: Bukowa <gitbukowa@gmail.com>

* chore(tests): add `test-bump-initial-tag-cli-arg`

Signed-off-by: Bukowa <gitbukowa@gmail.com>

* chore(tests): add `test-bump-initial-tag`

Signed-off-by: Bukowa <gitbukowa@gmail.com>

* chore(ci,tests): add tests to `text-fixtures.yml`

Signed-off-by: Bukowa <gitbukowa@gmail.com>

* chore(ci,tests): check if cli arg overwrites config file

Signed-off-by: Bukowa <gitbukowa@gmail.com>

* chore(ci,tests): fix chmod for commit files

Signed-off-by: Bukowa <gitbukowa@gmail.com>

* chore(docs): add cli flag to args.md

Signed-off-by: Bukowa <gitbukowa@gmail.com>

* chore(lint): rustfmt

Signed-off-by: Bukowa <gitbukowa@gmail.com>

* chore(lint): fix formatting

Signed-off-by: Bukowa <gitbukowa@gmail.com>

* Revert "chore(docs): add cli flag to args.md"

This reverts commit 1499e40df2.

Signed-off-by: Bukowa <gitbukowa@gmail.com>

* feat(cli,args): remove `bump-initial-flag` and use `tag`

Signed-off-by: Bukowa <gitbukowa@gmail.com>

* Revert "chore(lint): fix formatting"

This reverts commit 02717efa19.

Signed-off-by: Bukowa <gitbukowa@gmail.com>

---------

Signed-off-by: Bukowa <gitbukowa@gmail.com>
2024-06-15 21:22:23 +03:00
ThetaDev
403d3dcd32
feat(codeberg): add Gitea support (#680)
* feat: add gitea integration

* fix: several fixes to get gitea working, add test fixture

* docs: update docs

* fix: cargo fmt

* fix: remove dbg trait

* fix: tests

* chore: remove vscode settings

* refactor: cleanup implementation

---------

Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2024-06-15 20:42:15 +03:00
Orhun Parmaksız
5b58a3771d
style(lint): fix formatting 2024-06-15 18:16:24 +03:00
Orhun Parmaksız
d14774ae4a
feat(changelog): make remote data available in context (#703) 2024-06-15 18:05:17 +03:00
Buk Bukowski
b7e323f8ec
style(lint): fix formatting (#702)
Signed-off-by: Bukowa <gitbukowa@gmail.com>
2024-06-15 16:40:24 +03:00
dependabot[bot]
25b8008acf
chore(deps): bump url from 2.5.0 to 2.5.1 (#691)
Bumps [url](https://github.com/servo/rust-url) from 2.5.0 to 2.5.1.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v2.5.0...v2.5.1)

---
updated-dependencies:
- dependency-name: url
  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-11 23:53:01 +03:00
Alexander
a51422dda9
test(template): add tests (#674)
* chore(test) : increase tests coverage

* fix
2024-06-05 23:56:15 +03:00
dependabot[bot]
17e3821a33
chore(deps): bump toml from 0.8.13 to 0.8.14 (#673)
Bumps [toml](https://github.com/toml-rs/toml) from 0.8.13 to 0.8.14.
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.13...toml-v0.8.14)

---
updated-dependencies:
- dependency-name: toml
  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-04 10:02:54 +03:00