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

vert sort order is confusing, when input version have "-" & "+" symbols #9

Open
tejaswiniVadlamudi opened this issue Oct 21, 2018 · 1 comment

Comments

@tejaswiniVadlamudi
Copy link

tejaswiniVadlamudi commented Oct 21, 2018

Hi,
I have below version of vert and go installed on my system:

ubuntu:~$ vert --version
vert version 0.1.0
ubuntu:~$ go version
go version go1.9.1 linux/amd64

When I tried the below case, I get output like:

ubuntu:~$ vert -s "^1.x" 1.1.0+98 1.1.0-98 1.2.0-23
1.1.0+98
ubuntu:~$ echo $?
2
ubuntu:~$ vert -f "^1.x" 1.1.0+98 1.1.0-98 1.2.0-23
1.1.0-98
1.2.0-23

I expected vert to return:
1.1.0-98
1.1.0+98
1.2.0-23

Somemore similar tests:

ubuntu:~$ vert -s 1.1.0+98 1.1.0-98 1.2.0-23
ubuntu:~$ echo $?
2
ubuntu:~$ vert -f 1.1.0+98 1.1.0-98 1.2.0-23
1.1.0-98
1.2.0-23
ubuntu:~$ vert -f "1.1.0+98" "1.1.0-98" "1.2.0-23"
1.1.0-98
1.2.0-23
ubuntu:~$ vert -s "1.1.0+98" "1.1.0-98" "1.2.0-23"
ubuntu:~$ echo $?
2

Is it a bug in vert tool or do I need to correct my view/assumption?

Please correct me if I am wrong anywhere.

Thanks,
Teja

@tejaswiniVadlamudi
Copy link
Author

A short update:
I have semver (2.1.0) version installed on my host. Here is some interesting output:

@ubuntu:~$ semver -r  "^1.0" 1.1.0-97 1.2.0-23
1.1.0-97
1.2.0-23
@ubuntu:~$ semver -r  "^1.0" 1.1.0-97 1.2.0-23 1.0.0-100
1.0.0-100
1.1.0-97
1.2.0-23
@ubuntu:~$ semver -r  "^1.0" 1.1.0-97 1.2.0-23 1.0.0+100
1.0.0
1.1.0-97
1.2.0-23
@ubuntu:~$ semver -r  "^1.0" 1.1.0-97 1.1.0+97 1.2.0-23
1.1.0-97
1.1.0
1.2.0-23
@ubuntu:~$ semver -r  "^1.x" 1.1.0-97 1.1.0+97 1.2.0-23
1.1.0-97
1.1.0
1.2.0-23
@ubuntu:~$ semver -r  ">1.1" 1.1.0-97 1.1.0+97 1.2.0-23
1.2.0-23
@ubuntu:~$ semver -r  ">=1.1" 1.1.0-97 1.1.0+97 1.2.0-23
1.1.0-97
1.1.0
1.2.0-23
@ubuntu:~$ semver -r  "^1.1" 1.1.0+97 1.2.0-23
1.1.0
1.2.0-23

Looks like sort order from semver points 1.2.0-23 as latest.

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

No branches or pull requests

1 participant