git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] git-read-tree.txt: correct sparse-checkout and skip-worktree description

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Sep 21, 2011, 07:48 UTC
Message-ID
<31152a2ddb83e37be1efce1d0cd742b71ea3efdd.1316590874.git.git@drmicha.warpmail.net>
In-Reply-To
<4E7996AA.4040909@drmicha.warpmail.net>

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 <git@drmicha.warpmail.net>
---
 Documentation/git-read-tree.txt |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt
index 0004f4b..1bd0317 100644
--- a/Documentation/git-read-tree.txt
+++ b/Documentation/git-read-tree.txt
@@ -389,12 +389,12 @@ directory update. `$GIT_DIR/info/sparse-checkout` is used to
 define the skip-worktree reference bitmap. When 'git read-tree' needs
 to update the working directory, it resets the skip-worktree bit in the index
 based on this file, which uses the same syntax as .gitignore files.
-If an entry matches a pattern in this file, skip-worktree will be
-set on that entry. Otherwise, skip-worktree will be unset.
+If an entry matches a pattern in this file, skip-worktree will not be
+set on that entry. Otherwise, skip-worktree will be set.
 
 Then it compares the new skip-worktree value with the previous one. If
-skip-worktree turns from unset to set, it will add the corresponding
-file back. If it turns from set to unset, that file will be removed.
+skip-worktree turns from set to unset, it will add the corresponding
+file back. If it turns from unset to set, that file will be removed.
 
 While `$GIT_DIR/info/sparse-checkout` is usually used to specify what
 files are in, you can also specify what files are _not_ in, using
-- 
1.7.7.rc0.469.g9eb94
Previous: Michael J GruberNext: Nguyen Thai Ngoc Duy
Message 15 of 23 in “git checkout under 1.7.6 does not properly list untracked files and aborts”
  1. Joshua JensenSep 9, 2011
  2. Joshua JensenSep 19, 2011
  3. Joshua JensenSep 19, 2011
  4. Michael J GruberSep 20, 2011
  5. Joshua JensenSep 20, 2011
  6. Michael J GruberSep 21, 2011
  7. 0/3 read-tree cleanupsMichael J Gruber, Sep 21, 2011
  8. Michael J GruberSep 21, 2011
  9. Junio C HamanoSep 21, 2011
  10. 1/3 unpack-trees: print "Aborting" to stderrMichael J Gruber, Sep 21, 2011
  11. Junio C HamanoSep 21, 2011
  12. Junio C HamanoSep 21, 2011
  13. Michael J GruberSep 22, 2011
  14. 2/3 git-read-tree.txt: language and typography fixesMichael J Gruber, Sep 21, 2011
  15. 3/3 git-read-tree.txt: correct sparse-checkout and skip-worktree descriptionMichael J Gruber, Sep 21, 2011
  16. Nguyen Thai Ngoc DuySep 21, 2011
  17. Michael J GruberSep 21, 2011
  18. Nguyen Thai Ngoc DuySep 21, 2011
  19. Michael J GruberSep 21, 2011
  20. Nguyen Thai Ngoc DuySep 21, 2011
  21. Michael J GruberSep 21, 2011
  22. Nguyen Thai Ngoc DuySep 21, 2011
  23. Nguyen Thai Ngoc DuySep 21, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.