Open anooshcnayak opened 3 years ago
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.
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.
Ah, that explains it. gtbump
only looks at annotated tags. Will change this.
@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? https://github.com/knadh/gtbump/blob/0fd740c8245de3175a46307f002c481863ba77e8/gtbump/__init__.py#L38
You can send a PR. Adding this shouldn't break backwards compatibility.
@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...
@bryanpedini the tool was created specifically for semver but a --prefix
flag should be fine. Please feel free to send a PR.
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.
I have a repo with tags already present. gtbump doesn't seem to work with tags already present in the repo
What am I missing here?