Skip to content

Strange behaviour with "parallel" codelines #29

@arthrarnld

Description

@arthrarnld

Describe the bug
Hey! I'm seeing some odd results when generating a changelog if the most recent tag (chronologically) is not in the same version line. I'm not sure if it's something I'm doing wrong... 🤔

To Reproduce

  1. I created a new repository and added commits and tags to master as follows (most recent on top, as per git log:
    feat: fifth commit on master
    feat: fourth commit on master  <-- tag v0.2.0
    chore: third commit on master
    fix: second commit on master   <-- tag v0.1.0
    feat: first commit on master
    
  2. Then I pretended I had a fix I needed to make on the v0.1.x line, so I checked out the tag, started a new branch and made a commit:
    fix: patch on v0.1.x          <-- tag v0.1.1
    fix: second commit on master  <-- tag v0.1.0
    feat: first commit on master
    
  3. When I generate the changelog for v0.1.1, I get the result I expected ("Patch on v0.1.x"), however the changelog for the unreleased commit on master is not:
    # Changelog
    All notable changes to this project will be documented in this file.
    
    ## [unreleased]
    
    ### Features
    
    - Fifth commit on master
    
    ## [0.2.0] - 2021-10-22
    
    ### Features
    
    - Fourth commit on master
    
    ### Miscellaneous Tasks
    
    - Third commit on master
    
    <!-- generated by git-cliff -->
    
    Using git cliff v0.2.0.. instead does give me the expected result.

Expected behavior
I expected the output of git cliff -u to be the same as git cliff v0.2.0.. in this case:

# Changelog
All notable changes to this project will be documented in this file.

## [unreleased]

### Features

- Fifth commit on master

<!-- generated by git-cliff -->

If this is the intended behaviour, just let me know and I'll adapt our CI jobs to use the explicit git refspec. Thanks! 🤗

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions