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

Could project clone have option for depth/shallow? #3985

Closed
arafalov opened this issue Apr 17, 2021 · 4 comments
Closed

Could project clone have option for depth/shallow? #3985

arafalov opened this issue Apr 17, 2021 · 4 comments
Labels
feature: context awareness meta: stale This issue/PR is stale and will be closed soon type: feature request New feature or request

Comments

@arafalov
Copy link

I assume that when the project is cloned, the full git history is kept. Sometimes, for long-running project, this may be a little overwhelming and not-necessary.

For example, I did a URL start for https://github.com/apache/lucene-solr/tree/branch_8x and the interface timed out several times before I got it to run, install ant, and compile and run Solr server (amazing!).

I wish there was a way to say "#....?shallow=true" or "?depth=10" or even a global setting. I do that for my own local copy, so why not for cloud one too. And it is been quite a while since Git was able to commit back to the branches even if not full history was cloned.

@gtsiolis
Copy link
Contributor

Thanks for bringing this up @arafalov! In the past this didn't make any difference (see #56) but a lot have chnaged since then. Looping in @csweichel and @svenefftinge in case this is something worth taking another look.

FWIW, another example project I've seen where shallow cloning helps is GitLab, see relevant installation instructions.

Use gdk install shallow_clone=true for a faster clone that consumes less disk-space. The clone
process uses git clone --depth=1.

@stale
Copy link

stale bot commented Jul 18, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Jul 18, 2021
@aledbf
Copy link
Member

aledbf commented Jul 18, 2021

Closing. After #4847 this should not be an issue. This will be available in the next release.
As example

time git clone https://github.com/kubernetes/kubernetes
Cloning into 'kubernetes'...
remote: Enumerating objects: 1252949, done.
remote: Counting objects: 100% (176/176), done.
remote: Compressing objects: 100% (115/115), done.
remote: Total 1252949 (delta 80), reused 61 (delta 61), pack-reused 1252773
Receiving objects: 100% (1252949/1252949), 765.54 MiB | 12.58 MiB/s, done.
Resolving deltas: 100% (902464/902464), done.
real	1m12,387s
user	1m3,651s
sys	0m6,077s
❯ du -sm kubernetes
1101	kubernetes
time git clone --filter=blob:none https://github.com/kubernetes/kubernetes
Cloning into 'kubernetes'...
remote: Enumerating objects: 844143, done.
remote: Counting objects: 100% (25/25), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 844143 (delta 5), reused 5 (delta 5), pack-reused 844118
Receiving objects: 100% (844143/844143), 146.35 MiB | 13.24 MiB/s, done.
Resolving deltas: 100% (542319/542319), done.
remote: Enumerating objects: 19520, done.
remote: Counting objects: 100% (14373/14373), done.
remote: Compressing objects: 100% (11302/11302), done.
remote: Total 19520 (delta 5976), reused 3071 (delta 3071), pack-reused 5147
Receiving objects: 100% (19520/19520), 34.89 MiB | 7.05 MiB/s, done.
Resolving deltas: 100% (7288/7288), done.
Updating files: 100% (23197/23197), done.
real	0m34,297s
user	0m9,171s
sys	0m5,286s
❯ du -sm kubernetes
508	kubernetes

@aledbf aledbf closed this as completed Jul 18, 2021
@gtsiolis
Copy link
Contributor

Thanks @aledbf for closing this and adding #4847! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: context awareness meta: stale This issue/PR is stale and will be closed soon type: feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants