anchor.diff:      rebar_utils:line_count(PatchLines).
   
   
  -parse_tags() ->
  +parse_tags(Dir) ->
       %% Don't abort on error, we want the bad return to be turned into 0.0.0
       case rebar_utils:sh("git log --oneline --no-walk --tags --decorate",
  -                        [{use_stdout, false}, return_on_error]) of
  +                        [{use_stdout, false}, return_on_error, {cd, Dir}]) of
           {error, _} ->
               {undefined, "0.0.0"};
           {ok, Line} ->
  
positive.code:                                                    {debug_abort_on_error, AbortMsg2}]),
                  rebar_utils:line_count(PatchLines);
              _ ->
                  get_patch_count(Tag)
          end,
      {TagVsn, RawRef, RawCount}.
  
  
negative.code:     rebar_utils:sh(?FMT("git checkout -q ~s", [Rev]), [{cd, Dir}]).
  
  make_vsn(Dir) ->
      {Vsn, RawRef, RawCount} = collect_default_refcount(Dir),
      {plain, build_vsn_string(Vsn, RawRef, RawCount)}.
  
  %% Internal functions
  
  collect_default_refcount(Dir) ->
      %% Get the tag timestamp and minimal ref from the system. The
      %% timestamp is really important from an ordering perspective.
      AbortMsg1 = "Getting log of git dependency failed in " ++ rebar_dir:get_cwd(),
      {ok, String} =
          rebar_utils:sh("git log -n 1 --pretty=format:\"%h\n\" ",
                         [{use_stdout, false},
                          {cd, Dir},
                          {debug_abort_on_error, AbortMsg1}]),
      RawRef = string:strip(String, both, $\n),
  
      {Tag, TagVsn} = parse_tags(Dir),
      {ok, RawCount} =
          case Tag of
              undefined ->
  