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

issue with projects with tags #1

Open
anooshcnayak opened this issue Jul 1, 2021 · 8 comments
Open

issue with projects with tags #1

anooshcnayak opened this issue Jul 1, 2021 · 8 comments

Comments

@anooshcnayak
Copy link

I have a repo with tags already present. gtbump doesn't seem to work with tags already present in the repo

image

What am I missing here?

@knadh
Copy link
Owner

knadh commented Jul 1, 2021

What does git describe --abbrev=0 say?

Your --show shows v0.0.1 as the latest tag, but git tag | tail -2 shows v0.1.0, an entirely different minor version. From this, it looks like you have semver tags in incorrect order.

gtbump is working as expected. It is bumping v0.0.1 to v0.0.2, but your repo already has the v0.0.2 at some point.

@anooshcnayak
Copy link
Author

git describe --abbrev=0 shows v0.0.1

Note: git describe --abbrev=0 --tags shows v0.1.0-20.8 -- shows all tags not just annotated

I'm attaching all the tags created (below image). I don't think I have messed up the semver order.

image

@knadh
Copy link
Owner

knadh commented Jul 5, 2021

Ah, that explains it. gtbump only looks at annotated tags. Will change this.

@anooshcnayak
Copy link
Author

@knadh
The change in the below line to return all tags should fix the issue. I could only see that this could affect backward compatibility & need to add a flag/option to consider non-annotated tags also. Is there any other issue you see with the fix? I was thinking of raising a PR?

tag = run("git describe --abbrev=0")

@knadh
Copy link
Owner

knadh commented Jul 12, 2021

You can send a PR. Adding this shouldn't break backwards compatibility.

@bryanpedini
Copy link

@knadh may I ask if tags without the v prefix are supported or will ever be in the future?
(perhaps with a config like git config --global user.name)

if necessary I can open a new issue and/or create a PR for this, maybe with --noprefix or a custom --prefix '<prefix>' for example...

@knadh
Copy link
Owner

knadh commented Aug 19, 2022

@bryanpedini the tool was created specifically for semver but a --prefix flag should be fine. Please feel free to send a PR.

@bryanpedini
Copy link

looking at the specification I thought SemVer actually didn't like the prefix, that's why I asked...
will definitely put up a PR for custom --prefix and perhaps a way to store a custom prefix setting globally that can be remembered by the program as soon as possible.

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

3 participants