Pengwin
Pengwin copied to clipboard
Shallow clone Ruby Git repository
While looking into this issue, I found that pengwin-setup.d/ruby.sh file clones full git repository. Will it not be better if --depth=1 (i.e. shallow clone) is used? It can save a lot of space and time.
Originally posted by @Biswa96 in https://github.com/WhitewaterFoundry/Pengwin/issues/513#issuecomment-522268135
See PR. https://github.com/WhitewaterFoundry/pengwin-setup/pull/195
There are two git clone commands. Here is my proposed patch:
diff --git a/pengwin-setup.d/ruby.sh b/pengwin-setup.d/ruby.sh
index d98bd75..169d159 100644
--- a/pengwin-setup.d/ruby.sh
+++ b/pengwin-setup.d/ruby.sh
@@ -10,7 +10,7 @@ if (whiptail --title "RUBY" --yesno "Would you like to download and install Ruby
createtmp
echo "Getting rbenv"
- git clone https://github.com/rbenv/rbenv.git ~/.rbenv
+ git clone --depth=1 https://github.com/rbenv/rbenv.git ~/.rbenv
echo "Configuring rbenv"
@@ -20,7 +20,7 @@ if (whiptail --title "RUBY" --yesno "Would you like to download and install Ruby
echo 'eval "$(rbenv init -)"' | sudo tee -a "${conf_path}"
echo "Getting ruby-build"
- git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
+ git clone --depth=1 https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo "Configuring ruby-build"
echo 'export PATH="${HOME}/.rbenv/plugins/ruby-build/bin:${PATH}"' | sudo tee -a "${conf_path}"