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

A way to get closest tag from current commit #130

Closed
ImUrX opened this issue Feb 18, 2023 · 7 comments · Fixed by #131
Closed

A way to get closest tag from current commit #130

ImUrX opened this issue Feb 18, 2023 · 7 comments · Fixed by #131

Comments

@ImUrX
Copy link

ImUrX commented Feb 18, 2023

We are representing versioning with git and I want to do v1.0.0/commit_hash instead of just commit_hash. Maybe adding a new constant called LAST_TAG would be nice.
In git commands for doing this, git describe --abbrev=0 HEAD should work out.

@baoyachi
Copy link
Owner

👍

@baoyachi
Copy link
Owner

@ImUrX Maybe you want use this git commands: git describe --tags --abbrev=0

@ImUrX
Copy link
Author

ImUrX commented Feb 20, 2023

Do you mind telling me the difference?

@baoyachi
Copy link
Owner

@ImUrX When I use this commands on my mac os :git describe --abbrev=0 HEAD, it's make error

➜  shadow-rs git:(master) git describe --abbrev=0 HEAD
fatal: No annotated tags can describe '57280c4a24b3b9a24feec5dfc09b5066cac7fde8'.
However, there were unannotated tags: try --tags.

Then add --tags exec ok

➜  shadow-rs git:(master) git describe --tags --abbrev=0 HEAD
v0.20.1
➜  shadow-rs git:(master)

Git version

➜  shadow-rs git:(master) git version
git version 2.39.2
➜  shadow-rs git:(master)

@baoyachi
Copy link
Owner

@ImUrX So, Do you still anticipate the LAST_TAG feature?

If you are looking forward to this feature, I can complete it.

@ImUrX
Copy link
Author

ImUrX commented Feb 23, 2023

Yeah, it would be nice having it!

@baoyachi
Copy link
Owner

baoyachi commented Feb 27, 2023

@ImUrX Now, you can upgrade new version by use LAST_TAG feature.

shadow-rs = "0.21.0"

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