antfu / changelogithub

Generate changelog for GitHub
MIT License
736 stars 33 forks source link

Get wrong latest tag if we have different-rule tag #28

Open Innei opened 2 years ago

Innei commented 2 years ago

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

antfu commented 2 years ago

Do you have any solutions in mind?

Innei commented 2 years ago

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?