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

[PATCH v2 2/2] Add explanation why we do not allow to sparse checkout to empty working tree

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Sep 22, 2011, 11:24 UTC
Message-ID
<1316690663-29382-2-git-send-email-pclouds@gmail.com>
In-Reply-To
<7vk4911ux8.fsf@alter.siamese.dyndns.org>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 unpack-trees.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/unpack-trees.c b/unpack-trees.c
index fcf40a0..bacb473 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -1119,8 +1119,13 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
 		}
 		if (ret < 0)
 			goto return_failed;
+		/*
+		 * Sparse checkout is meant to narrow down checkout area
+		 * but it does not make sense to narrow down to empty working
+		 * tree. This is usually a mistake in sparse checkout rules.
+		 * Do not allow users to do that.
+		 */
 		if (o->result.cache_nr && empty_worktree) {
-			/* dubious---why should this fail??? */
 			ret = unpack_failed(o, "Sparse checkout leaves no entry on working directory");
 			goto done;
 		}
-- 
1.7.3.1.256.g2539c.dirty
Previous: Joshua Jensen
Message 5 of 5 in “Re: [PATCH 1/2] sparse checkout: show error messages when worktree shaping fails”
  1. Joshua JensenSep 21, 2011
  2. Junio C HamanoSep 21, 2011
  3. 1/2 sparse checkout: show error messages when worktree shaping failsNguyễn Thái Ngọc Duy, Sep 22, 2011
  4. Joshua JensenSep 22, 2011
  5. 2/2 Add explanation why we do not allow to sparse checkout to empty working treeNguyễn Thái Ngọc Duy, Sep 22, 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.