Pengwin icon indicating copy to clipboard operation
Pengwin copied to clipboard

Shallow clone Ruby Git repository

Open sirredbeard opened this issue 6 years ago • 2 comments

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

sirredbeard avatar Aug 18 '19 01:08 sirredbeard

See PR. https://github.com/WhitewaterFoundry/pengwin-setup/pull/195

sirredbeard avatar Aug 19 '19 18:08 sirredbeard

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}"

Biswa96 avatar Aug 20 '19 04:08 Biswa96