-
-
Notifications
You must be signed in to change notification settings - Fork 933
Getting the latest tag of a remote repo #1071
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
Comments
This seems like something more people could benefit from, and I would be glad to see a PR. You could mark it as draft and play around with different APIs until it feels right. If the lines above a representative for a usecase, it could be a free function, otherwise it could (also) be a method on the |
Awesome, thanks 👍 |
We're using semantic versioning in our repo (like v1.2.3). The following line of code has been working for us for a long time:
However, it stopped working as of two days ago - now that list is empty even if we still have all these tags in the repo. I agree that a dedicated method would be good. |
@alpozcan GitPython does this using this snippet of code effectively with Even though it understands packed refs, maybe something changed with the format making it fail silently here. Maybe it would already help to add debug-logging to these portions instead of skipping them silently. A PR would of course be welcome for that. Thank you |
Any update on this? |
I haven't found the time then, sorry. @Wyko maybe you'd be interested in creating a PR for this feature? |
The following is from a question on StackOverflow I've asked some time ago:
I'd like to be able to check what's the latest tag for a given repo (I'm using CPython here as an example).
The following works:
and yields 'v3.9.0a6' because the blob looks something like this:
Someone suggested I can contribute this solution to
gitpython
and someone else suggested that thegit ls-remote
is pretty stable and well documented so parsing its output might be the right way to go when trying to get the latest tag of a remote repo.My question: would you like me to contribute this type of functionality? And if so, I'd appreciate a hint on where should it be / how it should be named / anything else.
The text was updated successfully, but these errors were encountered: