git-commit-vandalism/Documentation
Elijah Newren ecc7c8841d repo_read_index: add config to expect files outside sparse patterns
Typically with sparse checkouts, we expect files outside the sparsity
patterns to be marked as SKIP_WORKTREE and be missing from the working
tree.  Sometimes this expectation would be violated however; including
in cases such as:
  * users grabbing files from elsewhere and writing them to the worktree
    (perhaps by editing a cached copy in an editor, copying/renaming, or
     even untarring)
  * various git commands having incomplete or no support for the
    SKIP_WORKTREE bit[1,2]
  * users attempting to "abort" a sparse-checkout operation with a
    not-so-early Ctrl+C (updating $GIT_DIR/info/sparse-checkout and the
    working tree is not atomic)[3].
When the SKIP_WORKTREE bit in the index did not reflect the presence of
the file in the working tree, it traditionally caused confusion and was
difficult to detect and recover from.  So, in a sparse checkout, since
af6a51875a (repo_read_index: clear SKIP_WORKTREE bit from files present
in worktree, 2022-01-14), Git automatically clears the SKIP_WORKTREE
bit at index read time for entries corresponding to files that are
present in the working tree.

There is another workflow, however, where it is expected that paths
outside the sparsity patterns appear to exist in the working tree and
that they do not lose the SKIP_WORKTREE bit, at least until they get
modified.  A Git-aware virtual file system[4] takes advantage of its
position as a file system driver to expose all files in the working
tree, fetch them on demand using partial clone on access, and tell Git
to pay attention to them on demand by updating the sparse checkout
pattern on writes.  This means that commands like "git status" only have
to examine files that have potentially been modified, whereas commands
like "ls" are able to show the entire codebase without requiring manual
updates to the sparse checkout pattern.

Thus since af6a51875a, Git with such Git-aware virtual file systems
unsets the SKIP_WORKTREE bit for all files and commands like "git
status" have to fetch and examine them all.

Introduce a configuration setting sparse.expectFilesOutsideOfPatterns to
allow limiting the tracked set of files to a small set once again.  A
Git-aware virtual file system or other application that wants to
maintain files outside of the sparse checkout can set this in a
repository to instruct Git not to check for the presence of
SKIP_WORKTREE files.  The setting defaults to false, so most users of
sparse checkout will still get the benefit of an automatically updating
index to recover from the variety of difficult issues detailed in
af6a51875a for paths with SKIP_WORKTREE set despite the path being
present.

[1] https://lore.kernel.org/git/xmqqbmb1a7ga.fsf@gitster-ct.c.googlers.com/
[2] The three long paragraphs in the middle of
    https://lore.kernel.org/git/CABPp-BH9tju7WVm=QZDOvaMDdZbpNXrVWQdN-jmfN8wC6YVhmw@mail.gmail.com/
[3] https://lore.kernel.org/git/CABPp-BFnFpzwGC11TLoLs8YK5yiisA5D5-fFjXnJsbESVDwZsA@mail.gmail.com/
[4] such as the vfsd described in
https://lore.kernel.org/git/20220207190320.2960362-1-jonathantanmy@google.com/

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-01 23:37:48 -08:00
..
config repo_read_index: add config to expect files outside sparse patterns 2022-03-01 23:37:48 -08:00
howto Document how we do embargoed releases 2021-03-27 15:13:12 -07:00
RelNotes Last minute fixes before -rc1 2022-01-12 16:27:08 -08:00
technical Merge branch 'en/zdiff3' 2021-12-15 09:39:47 -08:00
.gitattributes
.gitignore doc lint: make "lint-docs" non-.PHONY 2021-10-15 10:29:11 -07:00
asciidoc.conf Doc: drop support for docbook-xsl before 1.72.0 2020-03-29 09:25:38 -07:00
asciidoctor-extensions.rb Merge branch 'ma/user-manual-markup-update' 2019-10-06 12:25:16 +09:00
blame-options.txt Merge branch 'bs/doc-blame-color-lines' 2021-10-18 15:47:58 -07:00
build-docdep.perl
cat-texi.perl
cmd-list.perl git.txt: add list of guides 2020-08-04 18:34:02 -07:00
CodingGuidelines CodingGuidelines: document which output goes to stdout vs. stderr 2021-12-04 17:26:41 -08:00
config.txt repo_read_index: add config to expect files outside sparse patterns 2022-03-01 23:37:48 -08:00
date-formats.txt doc: use only hyphens as word separators in placeholders 2021-11-09 09:39:11 -08:00
diff-format.txt Documentation/diff-format: state in which cases porcelain status is T 2021-10-04 13:07:18 -07:00
diff-generate-patch.txt doc: point to diff attribute in patch format docs 2021-04-28 13:34:44 +09:00
diff-options.txt Merge branch 'jn/log-m-does-not-imply-p' 2021-08-11 12:36:18 -07:00
doc-diff doc-diff: use single-colon rule in rendering Makefile 2020-02-18 13:53:30 -08:00
docbook-xsl.css
docbook.xsl
everyday.txto
fetch-options.txt fetch: document the --negotiate-only option 2021-06-30 14:57:22 -07:00
fix-texi.perl
git-add.txt add: implement the --sparse option 2021-09-28 10:31:02 -07:00
git-am.txt am: support --allow-empty to record specific empty patches 2021-12-15 17:04:19 -08:00
git-annotate.txt
git-apply.txt git-apply: add --allow-empty flag 2021-12-13 14:30:25 -08:00
git-archimport.txt doc: split placeholders as individual tokens 2021-10-28 09:57:09 -07:00
git-archive.txt archive: describe compression level option 2021-10-25 10:08:23 -07:00
git-bisect-lk2009.txt git-bisect-lk2009: make continuation of list indented 2020-10-08 14:01:15 -07:00
git-bisect.txt bisect: swap command-line options in documentation 2020-08-28 14:06:06 -07:00
git-blame.txt Merge branch 'bs/doc-blame-color-lines' 2021-10-18 15:47:58 -07:00
git-branch.txt Merge branch 'js/branch-track-inherit' 2022-01-10 11:52:54 -08:00
git-bugreport.txt Documentation: fix default directory of git bugreport -o 2021-09-07 14:25:13 -07:00
git-bundle.txt git-bundle.txt: add missing words and punctuation 2021-10-27 17:06:12 -07:00
git-cat-file.txt cat-file: disable refs/replace with --batch-all-objects 2021-10-08 15:45:14 -07:00
git-check-attr.txt Documentation: fix a bunch of typos, both old and new 2019-11-07 13:42:00 +09:00
git-check-ignore.txt Merge branch 'en/check-ignore' into maint 2020-03-17 15:02:23 -07:00
git-check-mailmap.txt check-mailmap doc: note config options 2021-01-12 14:04:40 -08:00
git-check-ref-format.txt
git-checkout-index.txt checkout-index: add --ignore-skip-worktree-bits option 2022-01-13 13:49:45 -08:00
git-checkout.txt Merge branch 'js/branch-track-inherit' 2022-01-10 11:52:54 -08:00
git-cherry-pick.txt doc: express grammar placeholders between angle brackets 2021-11-09 09:39:11 -08:00
git-cherry.txt
git-citool.txt
git-clean.txt Merge branch 'en/clean-nested-with-ignored' 2019-10-11 14:24:46 +09:00
git-clone.txt Merge branch 'en/sparse-checkout-set' 2022-01-03 16:24:15 -08:00
git-column.txt column: fix parsing of the '--nl' option 2021-08-26 14:36:27 -07:00
git-commit-graph.txt Merge branch 'ds/commit-graph-merging-fix' 2020-11-02 13:17:39 -08:00
git-commit-tree.txt Documentation: merge commit-tree --[no-]gpg-sign 2020-04-03 11:37:22 -07:00
git-commit.txt Document positive variant of commit and merge option "--no-verify" 2021-10-29 11:22:56 -07:00
git-config.txt doc: express grammar placeholders between angle brackets 2021-11-09 09:39:11 -08:00
git-count-objects.txt
git-credential-cache--daemon.txt
git-credential-cache.txt
git-credential-store.txt Merge branch 'cb/credential-store-ignore-bogus-lines' 2020-05-08 14:25:01 -07:00
git-credential.txt doc: fix git credential synopsis 2021-10-28 09:57:09 -07:00
git-cvsexportcommit.txt doc: express grammar placeholders between angle brackets 2021-11-09 09:39:11 -08:00
git-cvsimport.txt doc: use only hyphens as word separators in placeholders 2021-11-09 09:39:11 -08:00
git-cvsserver.txt Documentation: cleanup git-cvsserver 2021-09-16 20:47:48 -07:00
git-daemon.txt
git-describe.txt describe-doc: clarify default length of abbreviation 2021-05-17 15:56:29 +09:00
git-diff-files.txt doc: use only hyphens as word separators in placeholders 2021-11-09 09:39:11 -08:00
git-diff-index.txt doc: use only hyphens as word separators in placeholders 2021-11-09 09:39:11 -08:00
git-diff-tree.txt doc: use only hyphens as word separators in placeholders 2021-11-09 09:39:11 -08:00
git-diff.txt git-diff: fix missing --merge-base docs 2021-07-12 13:55:29 -07:00
git-difftool.txt difftool.c: learn a new way start at specified file 2021-02-22 13:35:49 -08:00
git-fast-export.txt fast-export: allow seeding the anonymized mapping 2020-06-25 14:19:23 -07:00
git-fast-import.txt fast-import: fix typo in documentation 2020-10-04 12:56:29 -07:00
git-fetch-pack.txt
git-fetch.txt Documentation: render special characters correctly 2021-07-30 09:08:12 -07:00
git-filter-branch.txt filter-branch doc: fix filter-repo typo 2020-10-20 12:22:25 -07:00
git-fmt-merge-msg.txt merge: allow to pretend a merge is made into a different branch 2021-12-20 14:55:02 -08:00
git-for-each-ref.txt ref-filter: --format=%(raw) support --perl 2021-07-26 12:01:25 -07:00
git-for-each-repo.txt for-each-repo: run subcommands on configured repos 2020-09-25 10:59:44 -07:00
git-format-patch.txt doc: git-format-patch: describe the option --always 2021-12-15 17:04:15 -08:00
git-fsck-objects.txt
git-fsck.txt doc: use three dots for indicating repetition instead of star 2021-11-09 09:39:11 -08:00
git-gc.txt docs: clarify that refs/notes/ do not keep the attached objects alive 2021-02-10 23:43:55 -08:00
git-get-tar-commit-id.txt
git-grep.txt docs: fix linting issues due to incorrect relative section order 2021-04-10 23:36:34 -07:00
git-gui.txt doc: express grammar placeholders between angle brackets 2021-11-09 09:39:11 -08:00
git-hash-object.txt
git-help.txt Merge branch 'ja/doc-cleanup' 2021-12-10 14:35:03 -08:00
git-http-backend.txt docs/http-backend: mention v2 protocol 2021-09-10 15:34:59 -07:00
git-http-fetch.txt doc: uniformize <URL> placeholders' case 2021-11-09 09:39:11 -08:00
git-http-push.txt doc: git-http-push: describe the refs as pattern pairs 2021-11-09 09:39:11 -08:00
git-imap-send.txt git-imap-send.txt: add note about localized Gmail folders 2020-08-31 11:44:33 -07:00
git-index-pack.txt index-pack: add --progress-title option 2021-09-07 10:59:23 -07:00
git-init-db.txt doc: use only hyphens as word separators in placeholders 2021-11-09 09:39:11 -08:00
git-init.txt init doc: --shared=0xxx does not give umask but perm bits 2021-11-09 09:39:11 -08:00
git-instaweb.txt
git-interpret-trailers.txt trailer: add new .cmd config option 2021-05-04 12:09:43 +09:00
git-log.txt doc: use only hyphens as word separators in placeholders 2021-11-09 09:39:11 -08:00
git-ls-files.txt ls-files: add --sparse option 2021-12-22 11:42:40 -08:00
git-ls-remote.txt docs: adjust for the recent rename of pu to seen 2020-06-25 09:18:53 -07:00
git-ls-tree.txt doc: clarify that --abbrev=<n> is about the minimum length 2020-11-04 14:04:44 -08:00
git-mailinfo.txt mailinfo: allow stripping quoted CR without warning 2021-05-10 15:06:22 +09:00
git-mailsplit.txt
git-maintenance.txt maintenance: add support for systemd timers on Linux 2021-09-07 10:57:04 -07:00
git-merge-base.txt
git-merge-file.txt update documentation for new zdiff3 conflictStyle 2021-12-01 14:45:59 -08:00
git-merge-index.txt doc: use three dots for indicating repetition instead of star 2021-11-09 09:39:11 -08:00
git-merge-one-file.txt
git-merge-tree.txt
git-merge.txt Merge branch 'jc/merge-detached-head-name' 2022-01-05 14:01:30 -08:00
git-mergetool--lib.txt mergetool: break setup_tool out into separate initialization function 2021-02-09 14:09:16 -08:00
git-mergetool.txt doc: describe mergetool configuration in git-mergetool(1) 2021-03-13 15:34:32 -08:00
git-mktag.txt docs: fix linting issues due to incorrect relative section order 2021-04-10 23:36:34 -07:00
git-mktree.txt
git-multi-pack-index.txt git-multi-pack-index.txt: change "folder" to "directory" 2021-10-25 11:06:56 -07:00
git-mv.txt doc: typeset short command-line options as literal 2016-06-28 08:20:52 -07:00
git-name-rev.txt
git-notes.txt docs: improve the example that illustrates git-notes path names 2020-08-03 12:40:09 -07:00
git-p4.txt doc: use only hyphens as word separators in placeholders 2021-11-09 09:39:11 -08:00
git-pack-objects.txt doc: express grammar placeholders between angle brackets 2021-11-09 09:39:11 -08:00
git-pack-redundant.txt doc: express grammar placeholders between angle brackets 2021-11-09 09:39:11 -08:00
git-pack-refs.txt
git-patch-id.txt
git-prune-packed.txt
git-prune.txt
git-pull.txt Merge branch 'js/retire-preserve-merges' 2021-10-18 15:47:56 -07:00
git-push.txt Merge branch 'ds/gender-neutral-doc' 2021-07-16 17:42:53 -07:00
git-quiltimport.txt
git-range-diff.txt Merge branch 'js/range-diff-one-side-only' 2021-02-17 17:21:41 -08:00
git-read-tree.txt Update documentation related to sparsity and the skip-worktree bit 2022-01-14 14:44:07 -08:00
git-rebase.txt update documentation for new zdiff3 conflictStyle 2021-12-01 14:45:59 -08:00
git-receive-pack.txt upload-pack: document and rename --advertise-refs 2021-08-05 08:59:37 -07:00
git-reflog.txt doc: express grammar placeholders between angle brackets 2021-11-09 09:39:11 -08:00
git-remote-ext.txt
git-remote-fd.txt
git-remote-helpers.txto
git-remote.txt doc: uniformize <URL> placeholders' case 2021-11-09 09:39:11 -08:00
git-repack.txt repack: make '--quiet' disable progress 2021-12-20 11:59:17 -08:00
git-replace.txt
git-request-pull.txt doc: uniformize <URL> placeholders' case 2021-11-09 09:39:11 -08:00
git-rerere.txt
git-reset.txt Documentation: call out commands that nuke untracked files/directories 2021-09-27 13:38:37 -07:00
git-restore.txt update documentation for new zdiff3 conflictStyle 2021-12-01 14:45:59 -08:00
git-rev-list.txt docs/rev-list: add some examples of --disk-usage 2021-02-17 16:25:29 -08:00
git-rev-parse.txt rev-parse: add option for absolute or relative path formatting 2020-12-12 23:35:51 -08:00
git-revert.txt Documentation: stylistically normalize references to Signed-off-by: 2020-10-20 11:57:40 -07:00
git-rm.txt rm: add --sparse option 2021-09-28 10:31:02 -07:00
git-send-email.txt send-email docs: add format-patch options 2021-10-28 09:06:15 -07:00
git-send-pack.txt send-pack: properly use parse_options() API for usage string 2021-09-12 18:57:30 -07:00
git-sh-i18n--envsubst.txt
git-sh-i18n.txt
git-sh-setup.txt
git-shell.txt
git-shortlog.txt doc: use only hyphens as word separators in placeholders 2021-11-09 09:39:11 -08:00
git-show-branch.txt
git-show-index.txt Documentation: mark --object-format=sha256 as experimental 2020-08-17 10:50:14 -07:00
git-show-ref.txt
git-show.txt doc/git-show: include --diff-merges description 2020-12-21 13:47:32 -08:00
git-sparse-checkout.txt Update documentation related to sparsity and the skip-worktree bit 2022-01-14 14:44:07 -08:00
git-stage.txt doc: express grammar placeholders between angle brackets 2021-11-09 09:39:11 -08:00
git-stash.txt stash: implement '--staged' option for 'push' and 'save' 2021-10-18 13:09:21 -07:00
git-status.txt status: print stash info with --porcelain=v2 --show-stash 2021-10-21 17:24:30 -07:00
git-stripspace.txt
git-submodule.txt submodule: fall back to remote's HEAD for missing remote.<name>.branch 2020-06-24 09:14:21 -07:00
git-svn.txt Merge branch 'ja/doc-cleanup' 2021-12-10 14:35:03 -08:00
git-switch.txt Merge branch 'js/branch-track-inherit' 2022-01-10 11:52:54 -08:00
git-symbolic-ref.txt
git-tag.txt Documentation: typofix --column description 2021-02-19 19:36:47 -08:00
git-tools.txt
git-unpack-file.txt
git-unpack-objects.txt
git-update-index.txt Update documentation related to sparsity and the skip-worktree bit 2022-01-14 14:44:07 -08:00
git-update-ref.txt update-ref: allow creation of multiple transactions 2020-11-16 13:44:01 -08:00
git-update-server-info.txt
git-upload-archive.txt
git-upload-pack.txt Merge branch 'jk/http-server-protocol-versions' 2021-09-23 13:44:47 -07:00
git-var.txt var: add GIT_DEFAULT_BRANCH variable 2021-11-03 13:25:36 -07:00
git-verify-commit.txt
git-verify-pack.txt
git-verify-tag.txt
git-version.txt documentation: add documentation for 'git version' 2021-09-14 10:05:40 -07:00
git-web--browse.txt doc: split placeholders as individual tokens 2021-10-28 09:57:09 -07:00
git-whatchanged.txt
git-worktree.txt git-worktree.txt: add missing -v to synopsis for worktree list 2021-12-04 23:27:25 -08:00
git-write-tree.txt
git.txt Merge branch 'if/redact-packfile-uri' 2021-12-10 14:35:04 -08:00
gitattributes.txt docs: document symlink restrictions for dot-files 2021-05-04 11:52:03 +09:00
gitcli.txt Merge branch 'jc/doc-single-h-is-for-help' into maint 2020-03-17 15:02:24 -07:00
gitcore-tutorial.txt doc/gitcore-tutorial: fix prose to match example command 2020-01-08 08:56:40 -08:00
gitcredentials.txt doc: uniformize <URL> placeholders' case 2021-11-09 09:39:11 -08:00
gitcvs-migration.txt
gitdiffcore.txt Merge branch 'en/ort-perf-batch-8' 2021-03-22 14:00:24 -07:00
giteveryday.txt docs: adjust for the recent rename of pu to seen 2020-06-25 09:18:53 -07:00
gitfaq.txt Update docs for change of default merge backend 2021-08-05 15:35:02 -07:00
gitglossary.txt
githooks.txt githooks.txt: clarify documentation on reference-transaction hook 2021-03-01 09:02:01 -08:00
gitignore.txt gitignore.txt: change "folder" to "directory" 2021-10-25 11:06:56 -07:00
gitk.txt doc: log, gitk: move '-L' description to 'line-range-options.txt' 2020-11-01 15:54:14 -08:00
gitmailmap.txt docs: document symlink restrictions for dot-files 2021-05-04 11:52:03 +09:00
gitmodules.txt docs: document symlink restrictions for dot-files 2021-05-04 11:52:03 +09:00
gitnamespaces.txt doc lint: lint and fix missing "GIT" end sections 2021-04-10 23:36:34 -07:00
gitremote-helpers.txt Merge branch 'bc/sha-256-part-2' 2020-07-06 22:09:13 -07:00
gitrepository-layout.txt Merge branch 'sg/dir-trie-fixes' 2019-11-10 18:02:14 +09:00
gitrevisions.txt
gitsubmodules.txt doc: uniformize <URL> placeholders' case 2021-11-09 09:39:11 -08:00
gittutorial-2.txt
gittutorial.txt Documentation: render special characters correctly 2021-07-30 09:08:12 -07:00
gitweb.conf.txt gitweb: add "e-mail privacy" feature to redact e-mail addresses 2021-04-08 15:54:26 -07:00
gitweb.txt gitweb.txt: change "folder" to "directory" 2021-10-25 11:06:57 -07:00
gitworkflows.txt doc: uniformize <URL> placeholders' case 2021-11-09 09:39:11 -08:00
glossary-content.txt docs: improve fast-forward in glossary content 2021-05-19 21:11:49 +09:00
howto-index.sh
i18n.txt i18n.txt: camel case and monospace "i18n.commitEncoding" 2021-02-24 15:21:25 -08:00
install-doc-quick.sh
install-webdoc.sh
line-range-format.txt doc: add more pointers to gitattributes(5) for userdiff 2020-11-01 15:54:14 -08:00
line-range-options.txt blame-options.txt: also mention 'funcname' in '-L' description 2020-11-01 15:54:14 -08:00
lint-gitlink.perl doc lint: make "lint-docs" non-.PHONY 2021-10-15 10:29:11 -07:00
lint-man-end-blurb.perl doc lint: emit errors on STDERR 2021-10-15 10:16:57 -07:00
lint-man-section-order.perl doc lint: emit errors on STDERR 2021-10-15 10:16:57 -07:00
Makefile Merge branch 'ab/fix-make-lint-docs' 2021-10-29 15:43:13 -07:00
manpage-base-url.xsl.in
manpage-bold-literal.xsl manpage-bold-literal.xsl: stop using git.docbook.backslash 2020-03-29 09:25:38 -07:00
manpage-normal.xsl manpage-normal.xsl: fold in manpage-base.xsl 2020-03-29 09:25:38 -07:00
manpage-quote-apos.xsl
manpage.xsl Documentation: fix build with Asciidoctor 2 2019-09-16 12:20:39 -07:00
merge-options.txt Document positive variant of commit and merge option "--no-verify" 2021-10-29 11:22:56 -07:00
merge-strategies.txt Update docs for change of default merge backend 2021-08-05 15:35:02 -07:00
MyFirstContribution.txt Merge branch 'jc/tutorial-format-patch-base' 2021-11-29 15:41:46 -08:00
MyFirstObjectWalk.txt docs: add headers in MyFirstObjectWalk 2021-10-29 13:02:51 -07:00
object-format-disclaimer.txt Documentation: mark --object-format=sha256 as experimental 2020-08-17 10:50:14 -07:00
pretty-formats.txt Merge branch 'es/pretty-describe-more' 2021-12-15 09:39:48 -08:00
pretty-options.txt log: document --encoding behavior on iconv() failure 2021-10-29 14:35:59 -07:00
pull-fetch-param.txt refspec: add support for negative refspecs 2020-09-30 14:52:00 -07:00
ref-reachability-filters.txt Doc: prefer more specific file name 2020-09-18 15:41:56 -07:00
rev-list-description.txt git-log.txt: include rev-list-description.txt 2020-07-08 22:08:54 -07:00
rev-list-options.txt Merge branch 'jk/strbuf-addftime-seconds-since-epoch' 2021-12-10 14:35:07 -08:00
revisions.txt revisions(7): clarify that most commands take a single revision range 2021-05-18 10:08:03 +09:00
sequencer.txt
signoff-option.txt Documentation: stylistically normalize references to Signed-off-by: 2020-10-20 11:57:40 -07:00
SubmittingPatches Merge branch 'jc/doc-submitting-patches-choice-of-base' 2022-01-10 11:52:55 -08:00
texi.xsl
trace2-target-values.txt docs: mention trace2 target-dir mode in git-config 2019-10-04 09:26:42 +09:00
transfer-data-leaks.txt
urls-remotes.txt doc: uniformize <URL> placeholders' case 2021-11-09 09:39:11 -08:00
urls.txt Doc: Bundle file usage 2019-10-21 12:02:39 +09:00
user-manual.conf user-manual.conf: don't specify [listingblock] 2020-03-31 16:08:02 -07:00
user-manual.txt Update docs for change of default merge backend 2021-08-05 15:35:02 -07:00