Comments (1)
Hello! Thanks for reporting this.
I can say that this is not the indented behaviour for this case. Using -u
should not include any tagged commits in the changelog.
I created the following commit history for reproducing this issue:
* f95ee65 (tag: v0.1.1, fix_v1) fix: patch on v0.1.x
| * 709faef (HEAD -> master) feat: fifth commit on master
| * 8da0f06 (tag: v0.2.0) feat: fourth commit on master
| * 527cefd chore: third commit on master
|/
* a9f6323 (tag: v0.1.0) fix: second commit on master
* 2c9cadb feat: first commit on master
When -u
is specified, git-cliff
implicitly uses the following portion of the commit history:
f95ee65..HEAD
So it creates this changelog:
# Changelog
All notable changes to this project will be documented in this file.
## [unreleased]
### Features
- Fifth commit on master
## [0.2.0] - 2021-10-29
### Features
- Fourth commit on master
### Miscellaneous Tasks
- Third commit on master
<!-- generated by git-cliff -->
Chronologically, this is correct because f95ee65
is the last tagged commit:
- v0.1.1 (f95ee65) -> latest
- v0.2.0 (8da0f06)
- v0.1.0 (a9f6323)
But from the practical standpoint, doing this will obviously include the previously tagged commits. So for your use case, tags should be used by their "appearance order" in the commit history. Like this:
- v0.2.0 (8da0f06) -> latest
- v0.1.1 (f95ee65)
- v0.1.0 (a9f6323)
While searching for the roots of this issue, I realized this happens due to 000a67c. And this can be made easily opt-out with an extra flag.
That's why I added --topo-order
flag in cc09d63 which sorts the tags in topological order (children before parents). I believe this flag will be useful for similar scenarios as well.
So now git cliff --unreleased --topo-order
will give you the expected result:
# Changelog
All notable changes to this project will be documented in this file.
## [unreleased]
### Features
- Fifth commit on master
<!-- generated by git-cliff -->
Lastly, this flag will be available in the upcoming release so feel free to try it out and report bugs by either pulling the docker image or building from source.
Let me know if you have any questions/suggestions/ideas 🐻
(PS: Sorry for the late reply, I've been dealing with a job change + school stuff)
from git-cliff.
Related Issues (20)
- Docs unclear about Github token permissions HOT 3
- Add Nix Dev environment for easier reproducible dev envs HOT 2
- $ anchor in commit_preprocessors not works HOT 1
- Optional unconventional commit parsing into message/body/footer HOT 1
- allow limiting commits to scoped ones HOT 1
- --unreleased does not behave as expected with tags on side branches HOT 3
- merge identical commit messages HOT 2
- Allow the whole commit object to be used as a field inside of a commit parser HOT 2
- Bitbucket integration not working with self-hosted instance HOT 2
- Slow for large repositories with binary files in Git LFS and long history
- Config environment variables are not respected when cliff.toml is not found HOT 5
- Github integration is not run when printing context (`--context`) HOT 8
- Detailed template errors out with template render error HOT 2
- Change to MiniJinja HOT 8
- Regenerating changelog after taging changes the date
- [gitlab] context data are missing HOT 2
- Support a body template specifically for when there are no contributing commits HOT 1
- git-cliff-core: allow adding arbitrary values to commits HOT 6
- Allow disabling topological order for commits
- `--bumped-version` does not return `initial_tag` if there are no conventional commits in the history. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-cliff.