I am trying to get the latest tag in the repo using GitPython lib. Usually I was doing it this way:
repo = Repo(project_root)
last_tag = str(repo.tags[-1])
But once version 1.10 was released, I am always getting 1.9 ;( I know it's related to output git tag -l
being listing same order. So it will be 1.1, 1.10, 1.2, ..., 1.9
The question is how to get the latest tag using GitPython? (I am aware of git tag -l | sort -V
and I know how to solve this not using the repo object. But maybe someone knows what am I missing in getting sorted tags list in this lib)
Custom sorting function is always an option too, but still, I wonder if there a way to do it with GitPython?
python v2.7.6
,gitpython v0.1.7
. What version are you using? – Laxative