Skip to content

Relevant tags are missing when using --include-path #208

@cjorge-graphops

Description

@cjorge-graphops

Describe the bug

When using --include-path, the first release tag goes missing.
Also, if there is a tag that points to a commit that is filtered out by --include-path, then that tag no longer shows on the change log and the commits that do show, show as unreleased instead.

To reproduce

I'm running the following script to reproduce the issues:

#!/bin/bash

rm -Rf reproduce-repo
mkdir reproduce-repo
cd reproduce-repo
git init
mkdir included-path
touch included-path/{a,b,c}
git add included-path/a
git commit -m "feat: add a"
git tag release-v0.1.0
git add included-path/b
git commit -m "feat: add b"
git tag release-v0.2.0
git add included-path/c
git commit -m "feat: add c"
git tag release-v0.3.0
git-cliff -i
sed -i 's/tag_pattern = .*/tag_pattern = "release*"/g' cliff.toml
echo "######## WITHOUT INCLUDE PATH #############"
git-cliff -c cliff.toml
echo "######## WITH INCLUDE PATH, FIST TAG MISSING #############"
git-cliff -c cliff.toml --include-path "included-path/**"
mkdir other-path
touch other-path/d
git add other-path/d
git commit -m "feat: add d"
touch included-path/e
git add included-path/e
git commit -m "feat: add e"
touch other-path/f
git add other-path/f
git commit -m "feat: add f"
git tag release-v0.4.0
echo "######## WITH INCLUDE PATH, SHOWS AS UNRELEASED #############"
git-cliff -c cliff.toml --include-path "included-path/**"

Expected behavior

I expected that when using --include-path, all the first three releases would show on the change log and instead the first one is missing.
I get this, which misses release-v0.1.0 tag:

Changelog

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

[release-v0.3.0] - 2023-06-30

Features

  • Add c

[release-v0.2.0] - 2023-06-30

Features

  • Add b

Regarding release-v0.4.0, I would expect it to show on change log but the relevant commit shows as unreleased:

Changelog

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

[unreleased]

Features

  • Add e

[release-v0.3.0] - 2023-06-30

Features

  • Add c

[release-v0.2.0] - 2023-06-30

Features

  • Add b

Software information

  • Operating system: Gentoo Linux, kernel 6.3.9
  • Rust version: rustc 1.69.0 (84c898d65 2023-04-16) (gentoo)
  • Project version: 1.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions