-
Notifications
You must be signed in to change notification settings - Fork 433
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
Use shallow git fetch with the same depth as the git clone #747
Conversation
This looks good. We can test it later this week on staging. https://staging.travis-ci.org/ |
Use shallow git fetch with the same depth as the git clone
This has been deployed to staging. |
This fails. https://staging.travis-ci.org/BanzaiMan/travis_staging_test/builds/505876#L117-L118 $ git fetch --depth=50 origin +refs/pull/32/merge:
fatal: git fetch-pack: expected shallow list |
The command's failure seems a bit unpredictable (for my test repository, anyway). It succeeds when given certain depths, but not always. travis@a1c334e0dcb4:~$ git clone --depth=50 https://github.com/BanzaiMan/travis_staging_test.git BanzaiMan/travis_staging_test
Cloning into 'BanzaiMan/travis_staging_test'...
remote: Counting objects: 194, done.
remote: Compressing objects: 100% (91/91), done.
remote: Total 194 (delta 103), reused 185 (delta 96), pack-reused 0
Receiving objects: 100% (194/194), 23.85 KiB | 0 bytes/s, done.
Resolving deltas: 100% (103/103), done.
Checking connectivity... done.
travis@a1c334e0dcb4:~$ cd BanzaiMan/travis_staging_test/
travis@a1c334e0dcb4:~/BanzaiMan/travis_staging_test$ git fetch --depth=50 origin +refs/pull/32/merge:
fatal: git fetch-pack: expected shallow list
travis@a1c334e0dcb4:~/BanzaiMan/travis_staging_test$ git fetch --depth=40 origin +refs/pull/32/merge:
fatal: git fetch-pack: expected shallow list
travis@a1c334e0dcb4:~/BanzaiMan/travis_staging_test$ git fetch --depth=10 origin +refs/pull/32/merge:
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 4 (delta 3), reused 4 (delta 3), pack-reused 0
Unpacking objects: 100% (4/4), done.
From https://github.com/BanzaiMan/travis_staging_test
* branch refs/pull/32/merge -> FETCH_HEAD |
Unless we can guarantee that |
According to the git documentation (https://git-scm.com/docs/git-fetch):
So the Even if that works, I will propose a different solution, so instead of doing a clone and a fetch of the branch, just do a shallow clone of the merge branch (available since git 1.7.10)
That way this clone will be a shallow clone of the repo but only for the merge branch, and git clone is technically doing a fetch but if no branch is specified it will clone the base branch. With the |
Unfortunately,
|
Pull request to address the issue travis-ci/travis-ci#6183