1
0
mirror of https://github.com/git/git.git synced 2024-09-23 16:43:11 +02:00
git/builtin
Elijah Newren 4ce504360b 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>
2022-02-20 00:01:15 -08:00
..
add.c i18n: turn even more messages into "cannot be used together" ones 2022-01-05 13:31:00 -08:00
am.c Merge branch 'ab/config-based-hooks-2' 2022-02-09 14:21:00 -08:00
annotate.c
apply.c
archive.c
bisect--helper.c
blame.c
branch.c Merge branch 'js/branch-track-inherit' 2022-01-20 15:25:38 -08:00
bugreport.c
bundle.c
cat-file.c cat-file: s/_/-/ in typo'd usage_msg_optf() message 2022-01-12 10:12:39 -08:00
check-attr.c
check-ignore.c
check-mailmap.c
check-ref-format.c
checkout--worker.c
checkout-index.c
checkout.c Merge branch 'ab/config-based-hooks-2' 2022-02-09 14:21:00 -08:00
clean.c
clone.c Merge branch 'jt/clone-not-quite-empty' 2022-02-09 14:21:01 -08:00
column.c
commit-graph.c
commit-tree.c
commit.c i18n: turn even more messages into "cannot be used together" ones 2022-01-05 13:31:00 -08:00
config.c
count-objects.c
credential-cache--daemon.c
credential-cache.c
credential-store.c
credential.c
describe.c i18n: turn even more messages into "cannot be used together" ones 2022-01-05 13:31:00 -08:00
diff-files.c
diff-index.c
diff-tree.c i18n: refactor "foo and bar are mutually exclusive" 2022-01-05 13:29:23 -08:00
diff.c builtin/diff.c: fix "git-diff" usage string typo 2022-02-02 11:30:53 -08:00
difftool.c i18n: turn "options are incompatible" into "cannot be used together" 2022-01-05 13:29:23 -08:00
env--helper.c
fast-export.c Merge branch 'ja/i18n-similar-messages' 2022-01-10 11:52:56 -08:00
fast-import.c
fetch-pack.c
fetch.c Merge branch 'tg/fetch-prune-exit-code-fix' 2022-02-11 16:56:01 -08:00
fmt-merge-msg.c
for-each-ref.c
for-each-repo.c
fsck.c
gc.c Merge branch 'ab/config-based-hooks-2' 2022-02-09 14:21:00 -08:00
get-tar-commit-id.c
grep.c
hash-object.c
help.c
hook.c git hook run: add an --ignore-missing flag 2022-01-07 15:19:34 -08:00
index-pack.c i18n: factorize "--foo requires --bar" and the like 2022-01-05 13:31:00 -08:00
init-db.c i18n: refactor "foo and bar are mutually exclusive" 2022-01-05 13:29:23 -08:00
interpret-trailers.c
log.c Merge branch 'ja/i18n-similar-messages' 2022-01-10 11:52:56 -08:00
ls-files.c Merge branch 'ja/i18n-similar-messages' 2022-01-10 11:52:56 -08:00
ls-remote.c
ls-tree.c
mailinfo.c
mailsplit.c
merge-base.c
merge-file.c
merge-index.c
merge-ours.c
merge-recursive.c
merge-tree.c
merge.c Merge branch 'en/plug-leaks-in-merge' 2022-02-09 14:21:00 -08:00
mktag.c
mktree.c
multi-pack-index.c
mv.c
name-rev.c name-rev.c: use strbuf_getline instead of limited size buffer 2022-01-10 09:39:26 -08:00
notes.c Merge branch 'ab/usage-die-message' 2022-01-10 11:52:53 -08:00
pack-objects.c i18n: turn "options are incompatible" into "cannot be used together" 2022-01-05 13:29:23 -08:00
pack-redundant.c
pack-refs.c
patch-id.c
prune-packed.c
prune.c
pull.c Merge branch 'pb/pull-rebase-autostash-fix' 2022-02-05 09:42:28 -08:00
push.c i18n: turn "options are incompatible" into "cannot be used together" 2022-01-05 13:29:23 -08:00
range-diff.c
read-tree.c
rebase.c Merge branch 'ab/config-based-hooks-2' 2022-02-09 14:21:00 -08:00
receive-pack.c Merge branch 'ab/config-based-hooks-2' 2022-02-09 14:21:00 -08:00
reflog.c builtin/reflog.c: use parse-options api for expire, delete subcommands 2022-01-10 14:13:06 -08:00
remote-ext.c
remote-fd.c
remote.c
repack.c Merge branch 'ja/i18n-similar-messages' 2022-01-10 11:52:56 -08:00
replace.c
rerere.c
reset.c i18n: turn even more messages into "cannot be used together" ones 2022-01-05 13:31:00 -08:00
rev-list.c i18n: turn even more messages into "cannot be used together" ones 2022-01-05 13:31:00 -08:00
rev-parse.c
revert.c
rm.c Merge branch 'ja/i18n-similar-messages' 2022-01-10 11:52:56 -08:00
send-pack.c
shortlog.c
show-branch.c i18n: turn "options are incompatible" into "cannot be used together" 2022-01-05 13:29:23 -08:00
show-index.c
show-ref.c
sparse-checkout.c sparse-checkout: error or warn when given individual files 2022-02-20 00:01:15 -08:00
stash.c Merge branch 'ab/cat-file' 2022-02-05 09:42:31 -08:00
stripspace.c
submodule--helper.c i18n: refactor "foo and bar are mutually exclusive" 2022-01-05 13:29:23 -08:00
symbolic-ref.c
tag.c i18n: tag.c factorize i18n strings 2022-01-05 13:31:00 -08:00
unpack-file.c
unpack-objects.c
update-index.c update-index: refresh should rewrite index in case of racy timestamps 2022-01-07 12:37:31 -08:00
update-ref.c
update-server-info.c
upload-archive.c
upload-pack.c
var.c
verify-commit.c
verify-pack.c
verify-tag.c
worktree.c Merge branch 'ab/config-based-hooks-2' 2022-02-09 14:21:00 -08:00
write-tree.c