Skip to content

Commit

Permalink
Update protocol recommendation
Browse files Browse the repository at this point in the history
  • Loading branch information
igaray committed Jun 19, 2015
1 parent 783ec79 commit 3ca3399
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Table of Contents:
* [Lock your dependencies](#lock-your-dependencies)
* [Loud errors](#loud-errors)
* [Properly use logging levels](#properly-use-logging-levels)
* [Prefer the git protocol when specifying dependency locations](#prefer-the-git-protocol-over-others-when-specifying-dependency-urls)
* [Prefer the https protocol when specifying dependency locations](#prefer-the-https-protocol-over-others-when-specifying-dependency-urls)
* [Suggestions & Great Ideas](#suggestions--great-ideas)
* [CamelCase over Under_Score](#camelcase-over-under_score)
* [Prefer shorter (but still meaningful) variable names](#prefer-shorter-but-still-meaningful-variable-names)
Expand Down Expand Up @@ -464,17 +464,16 @@ Following this rule you also get the benefits that `-opaque` types provide, for
* ``alert``: _There is no rule on when to use this level_
* ``emergency``: _There is no rule on when to use this level_

##### Prefer the git protocol over others when specifying dependency URLs
> When specifying dependencies in erlang.mk Makefils or rebar.config, prefer using the git protocol to download the dependency repository.
##### Prefer the https protocol over others when specifying dependency URLs
> When specifying dependencies in erlang.mk Makefiles or rebar.config, prefer using the https protocol to download the dependency repository.
*Examples*: [makefile example](src/dependency_protocol/dep_protocol.makefile) [rebar example](src/dependency_protocol/dep_protocol.config)

*Reasoning*: SSH requires authentication.
https may require authentication (bitbucket does, github doesn't), but sometimes doesn't.
In addition, https is chatty compared to the git protocol, optimized for cloning repos.
The git protocol's main disadvantage is that it doesn't support authentication, which is a plus for CI systems.
*Reasoning*: HTTPS is recommended by GitHub and is easier for CI.

* [Git on the Server - The Protocols](http://git-scm.com/book/ch4-1.html)
* [GitHub Official Recommendation](https://help.github.com/articles/which-remote-url-should-i-use/)
* [GitHub Protocol Comparison](https://gist.github.com/grawity/4392747#file-github-protocol-comparison-md)

## Suggestions & Great Ideas

Expand Down
5 changes: 3 additions & 2 deletions priv/rebar.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{deps, [
{bad, ".*", {git, "git://github.com/bad/bad.git", "master"}},
{good, ".*", {git, "git://github.com/good/good.git", "1.0.0"}}
{bad, ".*", {git, "git://github.com/bad/bad.git", "master"}},
{also_bad, ".*", {git, "git://github.com/good/good.git", "1.0.0"}}
{good, ".*", {git, "https://github.com/good/good.git", "1.0.0"}}
]}.
4 changes: 2 additions & 2 deletions src/dependency_protocol/dep_protocol.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

%% good
{deps,
{lager, "2.*", {git, "git://github.com/basho/lager.git", "2.0.0"}},
{jiffy, "0.*", {git, "git://github.com:davisp/jiffy.git", "0.13.3"}}
{lager, "2.*", {git, "https://github.com/basho/lager.git", "2.0.0"}},
{jiffy, "0.*", {git, "https://github.com:davisp/jiffy.git", "0.13.3"}}
}.
```

4 changes: 2 additions & 2 deletions src/dependency_protocol/dep_protocol.makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ dep_lager = git https://github.com/basho/lager.git 2.0.1
dep_jiffy = git https://github.com/davisp/jiffy.git 0.13.3

# good
dep_lager = git git://github.com/basho/lager.git 2.0.1
dep_jiffy = git git://github.com/davisp/jiffy.git 0.13.3
dep_lager = git https://github.com/basho/lager.git 2.0.1
dep_jiffy = git https://github.com/davisp/jiffy.git 0.13.3

0 comments on commit 3ca3399

Please sign in to comment.