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

Git shallow cloning is not used when branch is set #106

Open
1 task done
paiv opened this issue Aug 14, 2020 · 5 comments · May be fixed by #117
Open
1 task done

Git shallow cloning is not used when branch is set #106

paiv opened this issue Aug 14, 2020 · 5 comments · May be fixed by #117

Comments

@paiv
Copy link

paiv commented Aug 14, 2020

Report

What did you do?

bundle exec pod --verbose install

What did you expect to happen?

For Git dependencies, use --depth 1 when cloning.

What happened instead?

--depth 1 is not used:

% bundle exec pod --verbose install
  Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Example`: (``)

Fetching external sources
-> Pre-downloading: `YPImagePicker` from `https://github.com/Yummypets/YPImagePicker.git`, branch `bypass-compression`
  $ /opt/local/bin/git ls-remote https://github.com/Yummypets/YPImagePicker.git bypass-compression
  9fd06737d0ed9039ede045a85526d92477a8c562	refs/heads/bypass-compression
 > Git download
 > Git download
     $ /opt/local/bin/git clone https://github.com/Yummypets/YPImagePicker.git
     /var/folders/9v/8vsfgn095n58ypf76vmt6kjr0000gn/T/d20200814-84273-1nidkbq --template=
     Cloning into '/var/folders/9v/8vsfgn095n58ypf76vmt6kjr0000gn/T/d20200814-84273-1nidkbq'...

CocoaPods Environment

Stack

   CocoaPods : 1.10.0.beta.2
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
    RubyGems : 3.0.3
        Host : Mac OS X 10.15.6 (19G73)
       Xcode : 11.6 (11E708)
         Git : git version 2.28.0
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /Users/user/Downloads/some-b/.bundle/ruby/2.6.0/bin/pod

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-trunk       : 1.5.0
cocoapods-try         : 1.2.0

Podfile

platform :ios, '11.0'

target 'Example' do
  use_frameworks!

  pod 'YPImagePicker', :git => 'https://github.com/Yummypets/YPImagePicker.git', :branch => 'bypass-compression'
end
@paiv
Copy link
Author

paiv commented Aug 14, 2020

For default branch, shallow cloning is used:

pod 'YPImagePicker', :git => 'https://github.com/Yummypets/YPImagePicker.git'
% bundle exec pod --verbose install
  Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Example`: (``)

Fetching external sources
-> Pre-downloading: `YPImagePicker` from `https://github.com/Yummypets/YPImagePicker.git`
 > Git download
 > Git download
     $ /opt/local/bin/git clone https://github.com/Yummypets/YPImagePicker.git
     /var/folders/9v/8vsfgn095n58ypf76vmt6kjr0000gn/T/d20200814-84318-1mwgz3f --template= --single-branch --depth 1
     Cloning into '/var/folders/9v/8vsfgn095n58ypf76vmt6kjr0000gn/T/d20200814-84318-1mwgz3f'...

I've checked cocoapods-downloader, and it seems to handle branch and shallow cloning properly, so I suspect the issue is in how downloader is used.

@dnkoutso
Copy link
Contributor

Yes going to transfer in that repo. Want to try to make a PR for it?

@dimohamdy
Copy link

dimohamdy commented Apr 8, 2021

@paiv Can you check my PR?
#111

@paiv
Copy link
Author

paiv commented Apr 9, 2021

Works for me.

% bundle exec pod --verbose install
  Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Sample`: (``)

Fetching external sources
-> Pre-downloading: `YPImagePicker` from `https://github.com/Yummypets/YPImagePicker.git`, branch `bypass-compression`
  $ /opt/local/bin/git ls-remote https://github.com/Yummypets/YPImagePicker.git bypass-compression
  9fd06737d0ed9039ede045a85526d92477a8c562	refs/heads/bypass-compression
 > Git download
 > Git download
     $ /opt/local/bin/git clone https://github.com/Yummypets/YPImagePicker.git
     /var/folders/9v/8vsfgn095n58ypf76vmt6kjr0000gn/T/d20210409-18815-n4kcym --template= --single-branch --depth 1 --branch bypass-compression
     Cloning into '/var/folders/9v/8vsfgn095n58ypf76vmt6kjr0000gn/T/d20210409-18815-n4kcym'...
   $ /opt/local/bin/git -C /var/folders/9v/8vsfgn095n58ypf76vmt6kjr0000gn/T/d20210409-18815-n4kcym checkout --quiet
   9fd06737d0ed9039ede045a85526d92477a8c562

@cesarjorgemartinez
Copy link

cesarjorgemartinez commented Aug 7, 2024

For default branch, shallow cloning is used:

pod 'YPImagePicker', :git => 'https://github.com/Yummypets/YPImagePicker.git'
% bundle exec pod --verbose install
  Preparing

Analyzing dependencies

Inspecting targets to integrate
  Using `ARCHS` setting to build architectures of target `Pods-Example`: (``)

Fetching external sources
-> Pre-downloading: `YPImagePicker` from `https://github.com/Yummypets/YPImagePicker.git`
 > Git download
 > Git download
     $ /opt/local/bin/git clone https://github.com/Yummypets/YPImagePicker.git
     /var/folders/9v/8vsfgn095n58ypf76vmt6kjr0000gn/T/d20200814-84318-1mwgz3f --template= --single-branch --depth 1
     Cloning into '/var/folders/9v/8vsfgn095n58ypf76vmt6kjr0000gn/T/d20200814-84318-1mwgz3f'...

I've checked cocoapods-downloader, and it seems to handle branch and shallow cloning properly, so I suspect the issue is in how downloader is used.

Hi paiv,

I reach to this repository because the time wasted on my project builds, I use big size github repositories and I experimenting long time buildings. I tested that I can save 40% of time buildings, 30% disk, 60% network use and 10% cpu use.

I tested your suggestion (remove branch to use the default branch) and works correctly.

But, I have two questions:

  • I see that this problem is old. Because not correct and publish a new version? Is this project abandoned?

  • I have one suggestion that I think that is compatible:

Why not add an optional parameter of by example :shallowclone to false by default, and true regardless of the use of :commit / :tag / :branch / :submodules?

Reference issue: #145

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 a pull request may close this issue.

4 participants