-
Notifications
You must be signed in to change notification settings - Fork 517
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
Conversation
src/rebar_git_resource.erl
Outdated
git_clone_options() -> | ||
Option = case os:getenv("REBAR_GIT_CLONE_OPTIONS") of | ||
false -> "" ; %% env var not set | ||
[] -> "" ; %% env var set to empty |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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...").
could anyone merge this patch to master? |
I think I'm good with this, and since it's optional for now it's rather risk-free. @tsloughter agreeing? |
Yea. |
Thanks for the contribution, @simonxu72 |
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