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

Minor bug with git sparse checkout code

From
TRThomas Rinderknecht <thomasr@sailguy.org>
Date
Nov 7, 2010, 16:47 UTC
Message-ID
<loom.20101107T172926-284@post.gmane.org>
Hello,

First, let me begin by just saying thanks to all the git developers. We switched from cvs to git a few months ago, and it really is working well for us now that we have overcome the initial learning curve.

We make extensive use of the sparse checkout functionality because our repository is large and most developers don't need to see the entire source tree. Using sparse checkout helps reduce disk usage, and also helps maintain reasonable performance for commands such as "git status" that tend to get bogged down when talking to slow network storage appliances.

I found what appears to be a bug in the sparse-checkout code. I am more than happy to file a bug report on a bug tracking website, but I couldn't find one with a quick web search. I hope that it is acceptable to post the bug report here. Please let me know if further information is required, or if there is a better way to file the bug report.

Short description of the problem: --------------------------------- We have two subdirectories with similar names, for example "libs/lib1", and "libs/lib1a". We want to check out just "libs/lib1". The sparse-checkout file contains only a single line "libs/lib1/", but git still checks out both subdirectories (it appears to be doing a partial match)

Sequence for reproducing the bug: --------------------------------- (1) create a repository with similar directory names mkdir /tmp/git_bug cd /tmp/git_bug git init mkdir a1 touch a1/base mkdir a1-extra touch a1-extra/more git add . git commit -m "test"

(2) clone the repository, but don't check out the files mkdir /tmp/git_bug2 cd /tmp/git_bug2 git clone -n /tmp/git_bug . git config core.sparsecheckout true echo "a1/" .git/info/sparse-checkout git checkout ls <you should see that both a1 and a1_extra are checked out>

Note: We are currently using git version 1.7.2.3 ... I have not verified the bug
using the latest developmental code. Please accept my apologies if the issue has
already been addressed.
Thanks again,
Thomas R.
Next: Thomas Rinderknecht
Message 1 of 6 in “Minor bug with git sparse checkout code”
  1. Thomas RinderknechtNov 7, 2010
  2. Thomas RinderknechtNov 7, 2010
  3. dir.c: fix EXC_FLAG_MUSTBEDIR match in sparse checkoutNguyễn Thái Ngọc Duy, Nov 7, 2010
  4. Thomas RinderknechtNov 7, 2010
  5. Junio C HamanoNov 8, 2010
  6. Nguyen Thai Ngoc DuyNov 9, 2010

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.