Skip to content

Documentation for sparse_paths is missing the fact that it works like --no-cone mode #460

@jamie-pate

Description

@jamie-pate

Describe the bug

The sparse_paths flag uses echo "$sparse_paths" >> ./.git/info/sparse-checkout instead of using the expected git sparse-checkout set "${sparse_paths[@]}" command.

This behaves like git sparse-checkout set --no-cone [patterns] and you need to add special patterns /*,!/*/ to get the expected 'cone' behavior :(

https://git-scm.com/docs/git-sparse-checkout#_internalsfull_pattern_set

Reproduction steps

Probably just needs to be updated in the documentation... specify that it behaves like --no-cone mode and add some examples of how to checkout the top level files without checking out all subdirs

Create a repo that has some subdirectories, and some files at the root..

try to set sparse_paths: ["subdir]" and it will not checkout anything at the root level because you need to add the extra patterns: sparse_paths: ["/*", "!/*/", "/subdir/"]

Expected behavior

Documentation should mention that it behaves like --no-cone mode, or there should be a sparse_cone flag that can be set...

Additional context

https://git-scm.com/docs/git-sparse-checkout#_internalsfull_pattern_set

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions