Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Previous not populated when using --tag and --unreleased #47

Closed
iCrawl opened this issue Jan 18, 2022 · 2 comments
Closed

Previous not populated when using --tag and --unreleased #47

iCrawl opened this issue Jan 18, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@iCrawl
Copy link

iCrawl commented Jan 18, 2022

Describe the bug
git cliff --unreleased --tag 14.0.0 --prepend ./CHANGELOG.md

If a repo is needed:
https://github.com/discordjs/discord.js

Running:
cd packages/discord.js
git cliff --unreleased --tag 14.0.0 --prepend ./CHANGELOG.md -c ../../cliff.toml -r ../../

Will reproduce it, otherwise similar steps will most likely work too on any repo.

To Reproduce

[changelog]
header = """
# Changelog
All notable changes to this project will be documented in this file.\n
"""
body = """
{% if version %}\
    # [{{ version | trim_start_matches(pat="v") }}]\
    {% if previous %}\
        {% if previous.version %}\
            (https://github.com/discordjs/discord.js/compare/{{ previous.version }}...{{ version }})\
        {% else %}
            (https://github.com/discordjs/discord.js/tree/{{ version }})\
        {% endif %}\
    {% endif %} \
    - ({{ 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 %}\
            {% if commit.scope %}\
                **{{commit.scope}}:** \
            {% endif %}\
            {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/discordjs/discord.js/commit/{{ commit.id }}))\
    {% endfor %}
{% endfor %}\n
"""
trim = true
footer = ""

[git]
conventional_commits = true
filter_unconventional = true
commit_parsers = [
    { message = "^feat", group = "Features"},
    { message = "^fix", group = "Bug Fixes"},
    { message = "^docs", group = "Documentation"},
    { message = "^perf", group = "Performance"},
    { message = "^refactor", group = "Refactor"},
    { message = "^typings", group = "Typings"},
    { message = "^types", group = "Typings"},
    { message = ".*deprecated", body = ".*deprecated", group = "Deprecation"},
    { message = "^revert", skip = true},
    { message = "^style", group = "Styling"},
    { message = "^test", group = "Testing"},
    { message = "^chore", skip = true},
    { message = "^ci", skip = true},
    { message = "^build", skip = true},
    { body = ".*security", group = "Security"},
]
filter_commits = true
tag_pattern = "[0-9]*"
skip_tags = "v[0-9]*|11|12"
ignore_tags = ""
topo_order = false
sort_commits = "newest"

Expected behavior
Expect previous to be populated to based on the latest actual tag so the desired compare link can be generated with the config above.

Screenshots/Logs
Generated by creating a git tag manually and then running: git cliff --latest --prepend ./CHANGELOG.md
image

Generated by not creating a git tag and running git cliff --unreleased --tag 14.0.0 --prepend ./CHANGELOG.md
image

System (please complete the following information):

  • OS Information: [Windows 11 Pro / 10.0.22000 Build 22000]
  • Project Version: [dev-build 8bb48b0]
@iCrawl iCrawl added the bug Something isn't working label Jan 18, 2022
@orhun
Copy link
Owner

orhun commented Jan 23, 2022

This should be fixed in 2be04f8, can you try it out and let me know if it works as expected now?

@iCrawl
Copy link
Author

iCrawl commented Jan 24, 2022

Just tested it, works perfectly.

Thank you!

@iCrawl iCrawl closed this as completed Jan 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants