Skip to content

Commit

Permalink
Merge pull request #112 from bipthelin/vsn-gitfix
Browse files Browse the repository at this point in the history
No need for special case when in rel dir.
  • Loading branch information
evanmiller committed May 17, 2012
2 parents 8757d38 + e2e046f commit ca635fe
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions src/boss/boss_load.erl
Expand Up @@ -356,24 +356,14 @@ incoming_mail_controller_module(Application) ->
list_to_atom(lists:concat([Application, "_incoming_mail_controller"])).

vcs_vsn_cmd(git) ->
case rebar_rel_utils:is_rel_dir() of
false ->
%% git describe the last commit that touched CWD to make
%% sure we use local (CWD) history.
%% Required for correct versioning of apps in subdirs,
%% such as apps/app1.
case os:type() of
{win32,nt} ->
"FOR /F \"usebackq tokens=* delims=\" %i in "
"(`git log -n 1 \"--pretty=format:%h\" .`) do "
"@git describe --always --tags %i";
_ ->
"git describe --always --tags "
"`git log -n 1 --pretty=format:%h .`"
end;
{true, _} ->
%% Use global history (not CWD) git describe if in a rel_dir
"git describe --always --tags"
case os:type() of
{win32,nt} ->
"FOR /F \"usebackq tokens=* delims=\" %i in "
"(`git log -n 1 \"--pretty=format:%h\" .`) do "
"@git describe --always --tags %i";
_ ->
"git describe --always --tags "
"`git log -n 1 --pretty=format:%h .`"
end;
vcs_vsn_cmd(hg) -> "hg identify -i";
vcs_vsn_cmd(bzr) -> "bzr revno";
Expand Down

0 comments on commit ca635fe

Please sign in to comment.