mtkennerly / dunamai

Dynamic versioning library and CLI
https://dunamai.readthedocs.io/en/latest
MIT License
312 stars 24 forks source link

Pick up tags with / in name #16

Closed jess-sol closed 3 years ago

jess-sol commented 3 years ago

When tags include / in git, dunamai doesn't see them.

Example:

git init
git commit --allow-empty -m 1 # Avoid #14 
git commit --allow-empty -m 2
git tag v1.0.0
git commit --allow-empty -m 3
git tag test/v1.0.0

dunamai from git --debug --pattern '^test/v(?P<base>\d+\.\d+\.\d+)$'
# Pattern '^test/v(?P<base>\d+\.\d+\.\d+)$' did not match any tags from ['v1.0.0']

This is because on init.py#501 has the following:

git for-each-ref "refs/tags/*'

Which in the above case returns:

refs/tags/v1.0.0

If you use (two asterisks):

git for-each-ref "refs/tags/**'

It works as expected