* 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>
* 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>
* 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>
* 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>
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.
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).
* 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>
* 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>
* 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>