瀏覽代碼

Improve semantic versioning from git between tags

In the scenario we that we have selected a commit
that is between two tags, we should base the
version on the most recent tag we can see in the
revision history, but we should not treat this as
the tag version.

`git describe --tags` finds the most recent tag
visible in the revision history from the current
HEAD. Return this as the version string and
undefined as the tag to trigger ref counting.
pull/811/head
Zachary Hueras 9 年之前
父節點
當前提交
1469e59c3a
共有 1 個文件被更改,包括 7 次插入1 次删除
  1. +7
    -1
      src/rebar_git_resource.erl

+ 7
- 1
src/rebar_git_resource.erl 查看文件

@ -198,6 +198,12 @@ parse_tags(Dir) ->
{match,[Tag, Vsn]} ->
{Tag, Vsn};
nomatch ->
{undefined, "0.0.0"}
case rebar_utils:sh("git describe --tags",
[{use_stdout, false}, return_on_error, {cd, Dir}]) of
{error, _} ->
{undefined, "0.0.0"};
{ok, LatestVsn} ->
{undefined, string:strip(LatestVsn, both, $\n)}
end
end
end.

Loading…
取消
儲存