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

Initial version does not work if pattern is supplied #56

Open
jsok opened this issue Jan 14, 2022 · 1 comment
Open

Initial version does not work if pattern is supplied #56

jsok opened this issue Jan 14, 2022 · 1 comment

Comments

@jsok
Copy link
Contributor

jsok commented Jan 14, 2022

Effectively, if a pattern is supplied and no existing tags are found an error is always returned.

svu/internal/git/git.go

Lines 45 to 54 in 0b3a780

g, err := glob.Compile(pattern)
if err != nil {
return "", err
}
for _, tag := range tags {
if g.Match(tag) {
return tag, nil
}
}
return "", fmt.Errorf("no tags match '%s'", pattern)

Whereas if no pattern is supplied, it is not an error to find no tags:

svu/internal/git/git.go

Lines 38 to 40 in 0b3a780

if len(tags) == 0 {
return "", nil
}

@jsok jsok changed the title Initial version does not work if patttern is supplied Initial version does not work if pattern is supplied Mar 22, 2022
@harnash
Copy link

harnash commented Aug 30, 2023

I think this is quite useful when working inside monorepo.
This PR #57 looks promising. What needs to happen to have it implemented/fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants