concourse / concourse/git-resource

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

Open
#460 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Shell
Stars
203
Forks
305
Avg merge
11d 14h
Merged PRs (30d)
2

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the documentation for the sparse_paths flag and compare its behavior with the linked Git sparse-checkout documentation. Document that sparse_paths uses --no-cone-style patterns and add an example showing how to include top-level files alongside a subdirectory. Done means users can choose the required patterns without inferring the behavior from .git/info/sparse-checkout.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.