[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Get the latest tag

From: jgit-dev-bounces@xxxxxxxxxxx <jgit-dev-bounces@xxxxxxxxxxx> On Behalf Of Zgeras, Ioannis
Sent: February 21, 2019 8:57
To: jgit-dev@xxxxxxxxxxx
Subject: [jgit-dev] Get the latest tag




is it possible with jgit to get the latest tag? I couldnât find something.

Git.wrap(db). tagList() returns an unsorted list.

On Thu, Feb 21, 2019 at 3:53 PM Randall S. Becker <rsbecker@xxxxxxxxxxxxx> wrote:

Would the DescribeCommand help? This is typically used in git to find the most relevant annotated tag for building a release version string. It depends what you want to do with the tag, I suppose. I typically script:


git describe --long --first-parent --dirty=.dirty


when deploying.

yes, either use the DescribeCommand [1] or have a look at its implementation if you want something slightly different.