Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork938
Open
Labels
Description
The following is from a question onStackOverflow 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:
g=git.cmd.Git()blob=g.ls_remote('https://github.com/python/cpython',sort='-v:refname',tags=True)blob.split('\n')[0].split('/')[-1]
and yields 'v3.9.0a6' because the blob looks something like this:
'bc1c8af8ef2563802767404c78c8ec6d6a967897\trefs/tags/v3.9.0a6\ndcd4 (...)'
Someone suggested I can contribute this solution togitpython
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.