1
1
mirror of https://github.com/orhun/git-cliff.git synced 2024-12-15 18:44:21 +03:00
A highly customizable Changelog Generator that follows Conventional Commit specifications ⛰️
Go to file
bors[bot] 9692ea7e31
chore(pull): merge #200
200: fix(changelog): fix previous release references r=orhun a=tvcsantos

<!--- Thank you for contributing to git-cliff! ⛰️  -->

## Description

<!--- Describe your changes in detail -->

Currently the previous pointer is not available under the unreleased group when running `git cliff`. Also when running `git cliff --unreleased` the preivous release is not correct and is pointing to the release before last, instead of the last tagged release.

This PR deals with this by doing the following. For tackling the first problem we simply check if we produced more then one release at the end of the loop and add the missing pointers to the previous release.

For solving the other problem we just adapt the `checked_sub` argument to take the difference into account and fix it on the unreleased scenario, when it must be `1` instead of `2`.

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here. -->

Currently the previous pointer is not available under the unreleased group when running `git cliff`. Also when running `git cliff --unreleased` the preivous release is not correct and is pointing to the release before last, instead of the last tagged release. This PR deals with these problems. 

This is particularly useful for example on a Keep A Changelog format where we need the correct previous pointers so that we can add the proper link references.

## How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

I've added an extra fixture with a keep a changelog format example to test the scenario.

## Screenshots / Logs (if applicable)

## Types of Changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation (no code change)
- [ ] Refactor (refactoring production code)
- [ ] Other <!--- (provide information) -->

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [x] My code follows the code style of this project.
- [x] I have updated the documentation accordingly.
- [x] I have formatted the code with [rustfmt](https://github.com/rust-lang/rustfmt).
- [x] I checked the lints with [clippy](https://github.com/rust-lang/rust-clippy).
- [x] I have added tests to cover my changes.
- [x] All new and existing tests passed.


Co-authored-by: Tiago Santos <tvcsantos@gmail.com>
2023-06-27 14:06:57 +00:00
.github test: fix keep a changelog test case 2023-06-25 23:52:37 +01:00
config docs(config): add comments to the default configuration file 2023-04-27 00:16:24 +03:00
examples feat(changelog, config)!: replace --date-order by --topo-order 2022-12-16 18:43:13 +01:00
git-cliff style: fix formatting 2023-06-25 23:39:39 +01:00
git-cliff-core chore(pull): merge #201 #202 2023-06-27 08:27:48 +00:00
npm chore(release): prepare for v1.2.0 2023-04-28 16:16:55 +03:00
website feat(changelog)!: add postprocessors (#155) 2023-06-10 15:20:39 +02:00
.dockerignore chore(website): move website to website folder 2023-04-09 18:16:31 +03:00
.editorconfig chore(editorconfig): fix editorconfig syntax 2023-04-26 16:47:48 +03:00
.gitignore chore(project): remove unnecessary Cargo.lock entry from .gitignore 2021-10-22 16:49:59 +03:00
Cargo.lock chore(pull): merge #201 #202 2023-06-27 08:27:48 +00:00
Cargo.toml chore(deps): bump log from 0.4.18 to 0.4.19 2023-06-12 23:07:16 +00:00
CHANGELOG.md chore(release): prepare for v1.2.0 2023-04-28 16:16:55 +03:00
cliff.toml feat(config): add a custom configuration file for the repository 2023-04-27 00:39:55 +03:00
CNAME Create CNAME 2022-12-26 17:24:46 +01:00
CODE_OF_CONDUCT.md chore(project): rename 2021-05-30 01:45:03 +03:00
codecov.yml fix(project): use the correct branch for codecov (#65) 2022-03-13 13:17:59 +03:00
CONTRIBUTING.md chore(cargo): update MSRV to 1.64.0 2023-04-28 14:27:35 +03:00
Dockerfile refactor(docker): avoid copying volume inside container (#142) 2023-05-18 20:45:32 +02:00
LICENSE Initial commit 2021-05-11 01:54:45 +03:00
README.md style(readme): update the style for project name 2023-04-10 05:34:17 +03:00
RELEASE.md chore(release): set the new version in release script 2021-06-30 01:26:32 +03:00
release.sh fix(release): use the correct argument in release script 2023-04-28 15:17:00 +03:00
rust-toolchain.toml chore(ci): return to nightly builds (#73) 2022-03-29 14:44:45 +03:00
rustfmt.toml chore(fmt): remove normalize_comments from rustfmt.toml 2021-06-04 03:11:15 +03:00
SECURITY.md docs(github): add security policy 2023-04-04 22:38:28 +03:00




Documentation | Website

git-cliff can generate changelog files from the Git history by utilizing conventional commits as well as regex-powered custom parsers. The changelog template can be customized with a configuration file to match the desired format.

preview

Documentation

Learn how to use git-cliff from the documentation.

In The Media

Similar/Related Projects

  • git-journal - The Git Commit Message and Changelog Generation Framework
  • clog-cli - Generate beautiful changelogs from your Git commit history
  • relnotes - A tool to automatically generate release notes for your project.
  • cocogitto - A set of CLI tools for the conventional commit and semver specifications.
  • cliff-jumper - A NodeJS CLI tool that combines git-cliff and conventional-recommended-bump to semantically bump a NodeJS package and generate a git-cliff powered changelog.
  • release-plz - Release Rust packages from CI.

License

GNU General Public License (v3.0)

Copyright © 2021-2023, git-cliff contributors