anchor.diff:  
   %% read rebar.config file and return the {deps, V}
   deps(RebarFile) ->
  -    case file:consult(RebarFile) of
  -        {ok, Conf} ->
  -            case lists:keyfind(deps, 1, Conf) of
  -                {deps, Deps} ->
  -                    {ok, Deps};
  -                _ ->
  -                    {ok, []}
  -            end;
  -        Else ->
  -            Else
  -    end.
  +    get_value(deps, consult(RebarFile), []).
   
   do_clone_deps([]) ->
       ok;
  -do_clone_deps([{Name, _, Repo}|T]) ->
  -    Name1 = atom_to_list(Name),
  -    {Cmd, Url, Co} = Repo,
  -
  -    %% branch/tag it should checkout to
  -    Co1 = case Co of
  -              {_, V} -> V;
  -              Else -> Else
  -          end,
  -    Name2 = make_dep_name(Name1, Co1),
  +do_clone_deps([H|T]) when is_tuple(H) =:= false ->
  +    do_clone_deps(T);
  +do_clone_deps([H|T]) ->
  +    {Name, Repo} = name_and_repo(H),
  +    {Cmd, Url, Co} = case Repo of
  +                         V={_, _, _} ->
  +                             V;
  +                         {_Cmd, _Url, _Co, _} ->
  +                             {_Cmd, _Url, _Co}
  +                     end,
  +    Co1 = checkout_to(Co),
  +    DepName = make_dep_name(Name, Co1),
   
       %% command options: clone url path/to/dep -b Branch/Tag
  -    Opts = ["clone", Url, dep_path(Name2), "-b", Co1],
  -    io:format("dependency: ~s~n", [Name1]),
  -
  -    %% run the command
  +    DepPath = dep_path(DepName),
  +    Opts = ["clone", Url, DepPath],
  +    io:format("dependency: ~s~n", [Name]),
  +    %% clone
       exec(Cmd, Opts),
   
  +    %% checkout to Co1
  +    {ok, Cwd} = file:get_cwd(),
  +    ok = file:set_cwd(DepPath),
  +    exec(Cmd, ["checkout", Co1]),
  +    ok = file:set_cwd(Cwd),
  +
       %% check dependencies of the dependency
  -    RebarFile = rebar_conf_file(dep_path(Name2)),
  -    case deps(RebarFile) of
  -        {ok, Deps} ->
  -            do_clone_deps(Deps);
  -        {error, _} ->
  -            ok
  -    end,
  +    RebarFile = rebar_conf_file(dep_path(DepName)),
  +    do_clone_deps(deps(RebarFile)),
       do_clone_deps(T).
   
   erl_files(Dir) ->
       filelib:wildcard(filename:join([Dir, "*.erl"])).
  +
  +checkout_to({_, V}) -> V;
  +checkout_to(Else) -> Else.
  +
  +name_and_repo({Name, _, Repo}) ->
  +    {atom_to_list(Name), Repo};
  +name_and_repo({Name, _, Repo, _}) ->
  +    {atom_to_list(Name), Repo}.
  +
  +consult(File) ->
  +    AbsFile = filename:absname(File),
  +    case file:consult(AbsFile) of
  +        {ok, V} ->
  +            V;
  +        _ ->
  +            []
  +    end.
  +
  +get_value(Key, Opts, Default) ->
  +    case lists:keyfind(Key, 1, Opts) of
  +        {Key, Value} ->
  +            Value;
  +        _ -> Default
  +    end.
  +
  +check_libdirs([], _) ->
  +    ok;
  +check_libdirs([H|T], Fun) ->
  +    Dir = filename:absname(H),
  +    Conf = rebar_conf_file(Dir),
  +    check_libdirs(get_value(sub_dirs, Conf, []), Fun),
  +    Fun(get_value(deps, Conf, [])),
  +    check_libdirs(T, Fun).
  +
  +%% schema_to_git(X) ->
  +%%     re:replace(X, "https://", "git://", [{return, list}]).
  +
  +%% schema_to_https(X) ->
  +%%     re:replace(X, "git://", "https://", [{return, list}]).
  
positive.code:           end,
      Name2 = make_dep_name(Name1, Co1),
      RebarFile = rebar_conf_file(dep_path(Name2)),
      Acc1 = case deps(RebarFile) of
                 {ok, Deps} ->
                     deps_path(Deps, []);
                 {error, _} ->
                     []
             end,
      deps_path(T, [dep_path(Name2)|Acc ++ Acc1]).
  
  deps_ebin(Deps) ->
  
negative.code:     filename:join([?DEPS_PATH, X]).
  
  rebar_conf_file(X) ->
      filename:join([filename:absname(X), "rebar.config"]).
  
  ebin(X) ->
      %% X/ebin
  