changelogithub icon indicating copy to clipboard operation
changelogithub copied to clipboard

Get wrong latest tag if we have different-rule tag

Open Innei opened this issue 3 years ago • 2 comments

Hi, I have a project and have lots of tags. Not all of the tags is starts with v. E.g.

page_v3.19.1
v3.19.2
page_v3.19.2
v3.19.3
page_v3.19.3
v3.19.4
page_v3.19.4
v3.19.5
page_v3.19.5
v3.19.6
page_v3.19.6
v3.19.7
page_v3.19.7
v3.20.0
page_v3.20.0
v3.20.1
page_v3.20.1
v3.21.0
page_v3.21.0

The prefix with page_v is have nothing to do with v, I want to compare prefixes with v, not page_v. But I found the code, It always gets the latest tag and did not do anything to filter and compares newer tag.

https://github.com/antfu/changelogithub/blob/9913fd7c8d79f9d14d0a2beb21c0c91559fcbb7c/src/git.ts#L17

Innei avatar Jul 07 '22 07:07 Innei

Do you have any solutions in mind?

antfu avatar Jul 07 '22 07:07 antfu

Maybe provide an argument such as --prefix-with= and its default value to be v, then get all of the sorted git tags and do some filter?

Innei avatar Jul 07 '22 07:07 Innei