Comments (14)
So since 2.19 git has a partial clone option, which most likely isn't supported on the server-side widely.
Adding in for context: https://github.com/git/git/blob/v2.19.0/Documentation/technical/partial-clone.txt
In general sparse checkout would still grab the data, but it wouldn't show within the tree.
Reducing the depth is already an optional option.
So sparse checkout seems to really only make sense with partial cloning support in my view.
As the main point is not downloading unnecessary files and not download unnecessary files, but hide them (sparse checkout):
If I missed something, please correct me and add your thoughts.
from git-sync.
Could you give a specific use case, why that would be needed?
from git-sync.
This is very usefull when you have multi-purpose repository but you don't want to clone the full repository each each time, it saves time and disk space.
eg. a repository containing all sort of infrastructure configurations like kubernetes yml files and your json dashboards for grafana but you only want to clone those json as a volume for your grafana deployment.
from git-sync.
from git-sync.
https://git-scm.com/docs/git-read-tree#_sparse_checkout
git init
git remote add origin git://...
git config core.sparseCheckout true
echo "{REPO_PATH}/{DESIRED_SUBDIR}/*" > .git/info/sparse-checkout
git checkout {BRANCH}
from git-sync.
The problem with sparseCheckout is that still the whole repo will be cloned and then only specified folder will be checked into working tree. So, disk space and time still used.
from git-sync.
@trnl --depth 1
should solve this problem.
from git-sync.
I don't think --depth solves the same problem OP was asking about.
from git-sync.
I think that even without the benefits of a partial checkout, sparse checkouts can still be useful in some situations.
For instance, I have an application that iterates through the folders at the top level of a repository and then does some work with the yaml files it finds in each directory.
See this structure:
.
├── team-a_access
│ └── access.yaml
├── team-a_app
│ └── foo.yaml
├── team-b_service
│ └── foo.yaml
│ └── bar.yaml
├── team-c_access
│ └── hola.yaml
│ └── helloworld.yaml
├── team-c_app
│ └── something.yaml
└── team-c_backend
└── example.yaml
The folders belong to different teams and I would like each team to be able to run a separate deployment of this tool that operates only on their folders.
If git-sync
could perform a sparse checkout then I wouldn't need to modify my application to filter the folders or move each teams folders into a separate repo. There are good reasons to try and avoid both of those options for me.
from git-sync.
+1 sparse checkout would be a useful feature
from git-sync.
+1 sparse checkout would be a useful feature
+1 sparse checkout would be a useful feature
this sparse checkout feature is very important for decoupling Static Files from the new features release
from git-sync.
+1 sparse checkout would be a useful feature
+1 sparse checkout would be a useful feature
this sparse checkout feature is very important for decoupling Static Files from the new features release
+1 to this.
A case where this would be exceptionally useful is when using this utility in conjunction with Kubernetes to synchronise Airflow dags that are not isolated in their own separate repo.
from git-sync.
I'm not inherently against this idea, if someone wants to take a run at a design. It's not clear if it should be a flag with literal contents or a flag with a filename or something else.
from git-sync.
I think the main idea is when you specify GIT_SYNC_ROOT that the content of the repo ends there and not inside of a folder
from git-sync.
Related Issues (20)
- GitLab via ssh key HOT 3
- How to disable commit hash in the target folder? HOT 2
- Allow the submodule functionality for repos copied using vcs tool HOT 1
- Temporarily missing files when using $GITSYNC_LINK HOT 4
- Remediate security vulnerabilities on 4.1.0 HOT 5
- High vulnerability CVE-2023-6246 and CVE-2023-6779 HOT 1
- Issue with PYTHONPATH Resolution in git-sync 4.0.0 HOT 2
- v4 slack webhook HOT 6
- exechook behavior HOT 4
- Remediate 4.2.2 security vulnerabilities HOT 1
- Support GitHub App authentication HOT 7
- TODO: infra to make #878 work HOT 1
- Curious about real example raising race condition when using v3 HOT 1
- exechook working HOT 8
- TODO: shellcheck test_e2e.sh and test_git.sh HOT 5
- /bin/sh: ./build/test.sh: not found
- test_e2e.sh: use `local` for all variables defined inside functions HOT 2
- git-sync Multiple Vulnerabilities HOT 3
- how can put specific html folder from my git repo to nginx pod? HOT 2
- git-sync produced an intermediate file,the path of command is wrong HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git-sync.