我不熟悉phing和构建一个脚本来自动化一些构建任务。
是否有一种方法只检索最近添加到git中的标记?我可以拉出我所有标签的列表,但似乎不能过滤到最新的标签。
以下是获取我的git标记的相关代码:
<gittag
repository="${repo.dir.resolved}"
list="true"
outputProperty="versionTag"
pattern="v*" />上述输出的结果是一个标签列表(以“v”作为前缀):
[gittag] git-tag output: v1.0.0
v1.0.1
v1.0.2对于如何将其简化为v1.0.2,有什么想法吗?
发布于 2011-11-13 17:59:07
成功地完成了以下工作:
<exec
outputProperty="latestVersion"
command="git describe --tags `git rev-list --tags --max-count=1`"
dir="${repo.dir.resolved}"/>它确实有效,尽管我愿意接受一些建议,如果可以改进的话!
https://stackoverflow.com/questions/8113157
复制相似问题