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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

git submodule support broken when using git 2.9 #5555

Closed
1 task done
gfontenot opened this issue Jun 22, 2016 · 1 comment 路 Fixed by CocoaPods/cocoapods-downloader#58
Closed
1 task done

git submodule support broken when using git 2.9 #5555

gfontenot opened this issue Jun 22, 2016 · 1 comment 路 Fixed by CocoaPods/cocoapods-downloader#58

Comments

@gfontenot
Copy link
Contributor

Report

What did you do?

  1. Make sure you're using git 2.9
  2. Create a podfile with a single dependency: pod Argo -> 3.0.1
  3. run pod install

What did you expect to happen?

Argo is installed correctly

What happened instead?

CocoaPods fails to install Argo because git can't find the commit required for Curry (an internal testing dependency declared as a git submodule)

CocoaPods Environment

Stack

   CocoaPods : 1.0.1
        Ruby : ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin15]
    RubyGems : 2.4.5
        Host : Mac OS X 10.11.5 (15F34)
       Xcode : 7.3 (7D175)
         Git : git version 2.9.0
Ruby lib dir : /Users/gordon/.rubies/ruby-2.2.2/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 418b445059ae7b91d36c990602f6d65bfdc9c39b

Installation Source

Executable Path: /Users/gordon/.gem/ruby/2.2.2/bin/pod

Plugins

cocoapods-deintegrate : 1.0.0
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.0.0
cocoapods-try         : 1.0.0

Notes

This is an issue with the git command used to clone the repository. I believe the issue was introduced in git 2.9, although I haven't been able to verify. After doing some research, it looks like git 2.9 made a change so that command line flags are now sent to the submodule commands as well, where pre-2.9 releases ignored those flags for submodules.

That seems like a great change on the surface. But unfortunately for us, it means that using --depth=1 and --recursive in the same command will almost always result in a failed clone. This is because the submodule is also initially checked out using --depth=1 and so when it then tries to check out the commit specified by the .gitmodules file, it fails because it doesn't see that SHA in the git history. The only way it will succeed is if the specified commit also happens to be the HEAD of master.

This issue can be fixed by removing the --recursive flag from the initial git command, and then running git submodules --init --recursive inside the repo to pull down the submodules.

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.

2 participants