]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'en/present-despite-skipped'
authorJunio C Hamano <gitster@pobox.com>
Wed, 9 Mar 2022 21:38:23 +0000 (13:38 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 9 Mar 2022 21:38:23 +0000 (13:38 -0800)
In sparse-checkouts, files mis-marked as missing from the working tree
could lead to later problems.  Such files were hard to discover, and
harder to correct.  Automatically detecting and correcting the marking
of such files has been added to avoid these problems.

* en/present-despite-skipped:
  repo_read_index: add config to expect files outside sparse patterns
  Accelerate clear_skip_worktree_from_present_files() by caching
  Update documentation related to sparsity and the skip-worktree bit
  repo_read_index: clear SKIP_WORKTREE bit from files present in worktree
  unpack-trees: fix accidental loss of user changes
  t1011: add testcase demonstrating accidental loss of user modifications

1  2 
Documentation/config.txt
Documentation/git-sparse-checkout.txt
cache.h
config.c
sparse-index.c

Simple merge
index 94dad137b96849599b2485c1f454bf4305cbbee2,3da3d5a1007012b0b580e1a3c4b1a68e8abb5c65..88e55f432f3a6c83333d9404105d6ae436f180d2
@@@ -28,38 -38,36 +38,44 @@@ THE FUTURE
  COMMANDS
  --------
  'list'::
-       Describe the patterns in the sparse-checkout file.
+       Describe the directories or patterns in the sparse-checkout file.
  
  'set'::
 -      Enable the necessary config settings
 -      (extensions.worktreeConfig, core.sparseCheckout,
 -      core.sparseCheckoutCone) if they are not already enabled, and
 -      write a set of patterns to the sparse-checkout file from the
 +      Enable the necessary sparse-checkout config settings
 +      (`core.sparseCheckout`, `core.sparseCheckoutCone`, and
 +      `index.sparse`) if they are not already set to the desired values,
 +      and write a set of patterns to the sparse-checkout file from the
        list of arguments following the 'set' subcommand. Update the
        working directory to match the new patterns.
  +
- When the `--stdin` option is provided, the patterns are read from
- standard in as a newline-delimited list instead of from the arguments.
 +To ensure that adjusting the sparse-checkout settings within a worktree
 +does not alter the sparse-checkout settings in other worktrees, the 'set'
 +subcommand will upgrade your repository config to use worktree-specific
 +config if not already present. The sparsity defined by the arguments to
 +the 'set' subcommand are stored in the worktree-specific sparse-checkout
 +file. See linkgit:git-worktree[1] and the documentation of
 +`extensions.worktreeConfig` in linkgit:git-config[1] for more details.
 ++
+ When the `--stdin` option is provided, the directories or patterns are
+ read from standard in as a newline-delimited list instead of from the
+ arguments.
  +
  When `--cone` is passed or `core.sparseCheckoutCone` is enabled, the
- input list is considered a list of directories instead of
- sparse-checkout patterns.  This allows for better performance with a
- limited set of patterns (see 'CONE PATTERN SET' below).  Note that the
- set command will write patterns to the sparse-checkout file to include
- all files contained in those directories (recursively) as well as
- files that are siblings of ancestor directories. The input format
- matches the output of `git ls-tree --name-only`.  This includes
- interpreting pathnames that begin with a double quote (") as C-style
- quoted strings.  This may become the default in the future; --no-cone
- can be passed to request non-cone mode.
+ input list is considered a list of directories.  This allows for
+ better performance with a limited set of patterns (see 'CONE PATTERN
+ SET' below).  The input format matches the output of `git ls-tree
+ --name-only`.  This includes interpreting pathnames that begin with a
+ double quote (") as C-style quoted strings.  Note that the set command
+ will write patterns to the sparse-checkout file to include all files
+ contained in those directories (recursively) as well as files that are
+ siblings of ancestor directories. This may become the default in the
+ future; --no-cone can be passed to request non-cone mode.
+ +
+ When `--no-cone` is passed or `core.sparseCheckoutCone` is not enabled,
+ the input list is considered a list of patterns.  This mode is harder
+ to use and less performant, and is thus not recommended.  See the
+ "Sparse Checkout" section of linkgit:git-read-tree[1] and the "Pattern
+ Set" sections below for more details.
  +
  Use the `--[no-]sparse-index` option to use a sparse index (the
  default is to not use it).  A sparse index reduces the size of the
diff --cc cache.h
Simple merge
diff --cc config.c
Simple merge
diff --cc sparse-index.c
Simple merge