Skip to content

Commit 1f1f575

Browse files
Michael J Grubergitster
authored andcommitted
git-read-tree.txt: correct sparse-checkout and skip-worktree description
The description of .git/info/sparse-checkout and skip-worktree is exactly the opposite of what is true, which is: If a file matches a pattern in sparse-checkout, then (it is to be checked out and therefore) skip-worktree is unset for that file; otherwise, it is set (so that it is not checked out). Currently, the opposite is documented, and (consistently) read-tree's behavior with respect to bit flips is descibed incorrectly. Fix it. In hindsight, it would have been much better to have a "sparse-ignore" or "sparse-skip" file so that an empty file would mean a full checkout, and the file logic would be analogous to that of .gitignore, excludes and skip-worktree. Signed-off-by: Michael J Gruber <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cc1a2b6 commit 1f1f575

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Documentation/git-read-tree.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,12 +388,12 @@ directory update. `$GIT_DIR/info/sparse-checkout` is used to
388388
define the skip-worktree reference bitmap. When 'git read-tree' needs
389389
to update the working directory, it resets the skip-worktree bit in the index
390390
based on this file, which uses the same syntax as .gitignore files.
391-
If an entry matches a pattern in this file, skip-worktree will be
392-
set on that entry. Otherwise, skip-worktree will be unset.
391+
If an entry matches a pattern in this file, skip-worktree will not be
392+
set on that entry. Otherwise, skip-worktree will be set.
393393

394394
Then it compares the new skip-worktree value with the previous one. If
395-
skip-worktree turns from unset to set, it will add the corresponding
396-
file back. If it turns from set to unset, that file will be removed.
395+
skip-worktree turns from set to unset, it will add the corresponding
396+
file back. If it turns from unset to set, that file will be removed.
397397

398398
While `$GIT_DIR/info/sparse-checkout` is usually used to specify what
399399
files are in, you can also specify what files are _not_ in, using

0 commit comments

Comments
 (0)