Giter Club home page Giter Club logo

Comments (14)

stp-ip avatar stp-ip commented on July 19, 2024 1

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.

stp-ip avatar stp-ip commented on July 19, 2024

Could you give a specific use case, why that would be needed?

from git-sync.

sdurrheimer avatar sdurrheimer commented on July 19, 2024

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.

thockin avatar thockin commented on July 19, 2024

from git-sync.

sdurrheimer avatar sdurrheimer commented on July 19, 2024

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.

trnl avatar trnl commented on July 19, 2024

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.

sdurrheimer avatar sdurrheimer commented on July 19, 2024

@trnl --depth 1 should solve this problem.

from git-sync.

thockin avatar thockin commented on July 19, 2024

I don't think --depth solves the same problem OP was asking about.

from git-sync.

ribbybibby avatar ribbybibby commented on July 19, 2024

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.

 avatar commented on July 19, 2024

+1 sparse checkout would be a useful feature

from git-sync.

realei avatar realei commented on July 19, 2024

+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.

mirceaaaa avatar mirceaaaa commented on July 19, 2024

+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.

thockin avatar thockin commented on July 19, 2024

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.

jomach avatar jomach commented on July 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.