diff options
author | Elijah Newren <newren@gmail.com> | 2022-02-19 16:44:44 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-02-20 00:01:15 -0800 |
commit | 4ce504360bc3b240e570281fabe00a85027532c3 (patch) | |
tree | e7340456e42b74d9a22cf9a8eb243e092105275f /Documentation/git-sparse-checkout.txt | |
parent | sparse-checkout: pay attention to prefix for {set, add} (diff) | |
download | tgif-4ce504360bc3b240e570281fabe00a85027532c3.tar.xz |
sparse-checkout: error or warn when given individual files
The set and add subcommands accept multiple positional arguments.
The meaning of these arguments differs slightly in the two modes:
Cone mode only accepts directories. If given a file, it would
previously treat it as a directory, causing not just the file itself to
be included but all sibling files as well -- likely against users'
expectations. Throw an error if the specified path is a file in the
index. Provide a --skip-checks argument to allow users to override
(e.g. for the case when the given path IS a directory on another
branch).
Non-cone mode accepts general gitignore patterns. There are many
reasons to avoid this mode, but one possible reason to use it instead of
cone mode: to be able to select individual files within a directory.
However, if a file is passed to set/add in non-cone mode, you won't be
selecting a single file, you'll be selecting a file with the same name
in any directory. Thus users will likely want to prefix any paths they
specify with a leading '/' character; warn users if the patterns they
specify exactly name a file because it means they are likely missing
such a leading slash.
Reviewed-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-sparse-checkout.txt')
0 files changed, 0 insertions, 0 deletions