Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add git clone --reference path support #1844

Merged
merged 4 commits into from
Nov 13, 2018
Merged

Conversation

no-trace-of-time
Copy link
Contributor

When run rebar3 upgrade on multiple projects, most git clone for common deps are identical. So I add git clone --reference support.

Howto:
1.setup a enviroment variable REBAR_GIT_CLONE_OPTONS
export REBAR_GIT_CLONE_OPTIONS="--reference ~/.cache/repos.reference"
2.build a git local repos reference
mkdir -p ~/.cache/repos.reference
cd ~/.cache/repos.reference
git init --bare
git remote add lager https://github.com/.......
git remote add otp_vsn https://github.com/....
< all you deps share in all projects can be added here... not only in github...>
git fetch --all
3.build local new rebar3 version has this patch
git clone https://github.com/simonxu72/rebar3
cd ~/rebar3
./bootstrap
./rebar3 local install
4.rebar3 upgrade in your project.All git clone operation will be local

git_clone_options() ->
Option = case os:getenv("REBAR_GIT_CLONE_OPTIONS") of
false -> "" ; %% env var not set
[] -> "" ; %% env var set to empty
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this clause would be covered fine under Opt -> Opt

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I did not get your point. Could you explain it with more detail?

Thx.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[] -> "" basically means "" -> "" which the clause Opt -> Opt would catch anyway

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.
[] and "" render the same result for io:format("...~ts...").

@no-trace-of-time
Copy link
Contributor Author

could anyone merge this patch to master?

@ferd
Copy link
Collaborator

ferd commented Nov 13, 2018

I think I'm good with this, and since it's optional for now it's rather risk-free. @tsloughter agreeing?

@tsloughter
Copy link
Collaborator

Yea.

@ferd ferd merged commit cad1da8 into erlang:master Nov 13, 2018
@ferd
Copy link
Collaborator

ferd commented Nov 13, 2018

Thanks for the contribution, @simonxu72

@ferd ferd mentioned this pull request Feb 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants