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

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

Open
cjorge-graphops opened this issue Jun 30, 2023 · 4 comments · May be fixed by #711
Open

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

cjorge-graphops opened this issue Jun 30, 2023 · 4 comments · May be fixed by #711
Labels
bug Something isn't working

Comments

@cjorge-graphops
Copy link

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
@cjorge-graphops cjorge-graphops added the bug Something isn't working label Jun 30, 2023
@welcome
Copy link

welcome bot commented Jun 30, 2023

Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️

@cjorge-graphops cjorge-graphops changed the title relevant tags are missing when using include-path Relevant tags are missing when using include-path Jul 1, 2023
@cjorge-graphops cjorge-graphops changed the title Relevant tags are missing when using include-path Relevant tags are missing when using --include-path Jul 1, 2023
@calinah
Copy link

calinah commented Jul 3, 2023

I am seeing the same issue as @cjorge-graphops

@DaniPopes DaniPopes linked a pull request Jun 16, 2024 that will close this issue
12 tasks
@lusor
Copy link

lusor commented Aug 1, 2024

I had the same issue that the first (inital) commit would not show up when using --include-path. I could track the issue to

if let Ok(prev_commit) = commit.parent(0) {
, where the parent commit is looked up. As the initial commit does not have a parent, the then-path is not followed and the commit is not included.

As diff_tree_to_tree allows to have one of the tree to be None, this could be given as old_tree.

@TimKnight-DWP
Copy link

I am seeing the same issue:
image

image

git log scoped to my directory shows commits with associated tags

if I run git cliff with just the tag-pattern, then it picks up the correct tag style and determines version based on the full history of my repo

but with include-path it ceases to find the tags

I want to be able to tag/version sub-directories of my repository in order to support a monorepo container factory, was hoping git cliff could give me that natively

@orhun orhun removed their assignment Nov 1, 2024
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

Successfully merging a pull request may close this issue.

5 participants